Method Tag
HTTP method tag web component: an uppercase monospace label coloured by method (GET, POST, PUT, PATCH, DELETE, WebSocket, gRPC…).
- 977 B gzipped
- @lit-material/method-tag 1.8.0
- Renders on the server
Example
Method tag
An HTTP or API method as a short monospace label, coloured by method. The text is the method, so colour is never the only cue.
Every method
Medium
Install
npm install @lit-material/method-tag @lit-material/tokens
import "@lit-material/method-tag";
Link @lit-material/tokens/css/index.css once per page for the colour, type and shape tokens. Install guide
API
<lit-material-method-tag>
An HTTP or API method as a short uppercase label in monospace, coloured by method: GET green, POST amber, PUT blue, PATCH violet, DELETE red, anything else (HEAD, OPTIONS, WS, GQL, SSE, gRPC…) the primary colour. The text is the method itself, so the meaning never rests on colour.
Properties
| Property | Attribute | Type | Default | Description |
|---|---|---|---|---|
method | method | string | "" | The method, e.g. GET, POST, WS. Shown in capitals. |
size | size | MethodTagSize | "small" | small (default, for lists) or medium. |
CSS parts
| Part | Description |
|---|---|
tag | The label. |
CSS custom properties
| Property | Description |
|---|---|
--lit-material-method-tag-get | GET's colour. |
--lit-material-method-tag-post | POST's colour. |
--lit-material-method-tag-put | PUT's colour. |
--lit-material-method-tag-patch | PATCH's colour. |
--lit-material-method-tag-delete | DELETE's colour. |
--lit-material-method-tag-other | Every other method's colour (default: primary). |
--lit-material-method-tag-font | The font (default: the system monospace). |