HttpMethodBadge
FrondUsage
The import, then a use to start from. Both copy as they are.
Import
import { HttpMethodBadge } from "@/components/ui/HttpMethodBadge";Example
<HttpMethodBadge method="GET" /><HttpMethodBadge method="POST" />When to use
Use it for
- An endpoint's method beside its path: API Explorer requests, an SDK's code snippets.
- Pass the raw
method; the badge owns the casing and the color (reads green, writes blue, updates yellow, deletes red).
Avoid
- A
Badgecolored by hand for a method.
Accessibility
Checks
- The method name is the text; the color only reinforces it.
API
Read from each component's stories, the same source as COMPONENTS.md, and kept in step by check:design-system.
HttpMethodBadge
Its stories don't declare
argTypes, so no props are listed. The variants show its states.VariantsDefaultAllMethods
Keep going
- BadgeStatic labels and counts. Neutral by default; status hues only when the badge is the status.Frond
- CopyableText, CodeSnippetValues a user copies: commands, keys, URLs.Fiddle
Color
Semantically named colors and a set of ramps for the full palette. Optimized for light and dark.