Protocol badge
Color + initial dual-coded badges for 12 protocols. Shared style across HTTP methods and transport protocols.
Basic usage
Supports GET / POST / PUT / PATCH / DELETE / HEAD / OPTIONS (HTTP) plus WS / MQTT / gRPC / SSE / GraphQL (transport / protocol).
Colors are driven by --proto-* tokens; the initial-letter encoding keeps them colorblind-friendly.
GETPOSTPUTPATCHDELHEADOPTSWSMQTTgRPCSSEGQL
<CfProtocolBadge kind="get" />
<CfProtocolBadge kind="post" />
<CfProtocolBadge kind="grpc" />
<CfProtocolBadge kind="ws" /> <CfProtocolBadge kind="get" />
<CfProtocolBadge kind="post" />
<CfProtocolBadge kind="grpc" />
<CfProtocolBadge kind="ws" /> CfMethodBadge alias
CfMethodBadge is an alias export of CfProtocolBadge, semantically dedicated to HTTP method lists.
API
| Prop | Type | Default | Description |
|---|---|---|---|
kind | ProtocolKind | string | — | Case-insensitive; unknown values render the original text on a default grey background |
size | 'sm' | 'md' | 'lg' | 'md' | 32×16 / 38×18 / 46×22 |
ProtocolKind = 'get' | 'post' | 'put' | 'patch' | 'del' | 'delete' | 'head' | 'options' | 'opt' | 'ws' | 'mqtt' | 'grpc' | 'sse' | 'gql' | 'graphql'
反馈与讨论
Protocol badge · Discussion