HttpMethodBadge

Frond
An endpoint's HTTP method as a status-colored Badge, in the hues the docs API reference uses.

Usage

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 Badge colored 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

Color
Semantically named colors and a set of ramps for the full palette. Optimized for light and dark.