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

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

PropertyAttributeTypeDefaultDescription
methodmethodstring""The method, e.g. GET, POST, WS. Shown in capitals.
sizesizeMethodTagSize"small"small (default, for lists) or medium.

CSS parts

PartDescription
tagThe label.

CSS custom properties

PropertyDescription
--lit-material-method-tag-getGET's colour.
--lit-material-method-tag-postPOST's colour.
--lit-material-method-tag-putPUT's colour.
--lit-material-method-tag-patchPATCH's colour.
--lit-material-method-tag-deleteDELETE's colour.
--lit-material-method-tag-otherEvery other method's colour (default: primary).
--lit-material-method-tag-fontThe font (default: the system monospace).

Source on GitHub npm