For AI agents: the complete documentation index is available at https://wallarm.github.io/design-system/llms.txt, the full documentation bundle is available at https://wallarm.github.io/design-system/llms-full.txt, and this page is available as Markdown at https://wallarm.github.io/design-system/components/http-method.md.

HttpMethod

Renders an HTTP method as a fixed-colour code Badge — the colour is part of the vocabulary rather than a choice: safe reads green, destructive rose, the technical verbs slate. A verb outside the seven known ones prints verbatim in slate, so nothing unexpected is swallowed; reach for Badge itself when what you are labelling is not a method.

Source · Storybook

Usage

import { HttpMethod } from '@wallarm-org/design-system/HttpMethod';

Examples

All methods

The seven methods with their locked colours, and an unrecognised verb underneath taking the slate fallback.

Sizes

medium, the default, is a 20px badge; large adds vertical padding to reach 24px and leaves the code type at 12px, so it is about air in the row, not emphasis.

Unknown method falls back to slate

TRACE, CONNECT and LINK are real verbs with no colour of their own, so they come out slate rather than being dropped or rewritten.

Props

PropTypeDefaultDescription
method *(string & {}) | HttpMethodNameHTTP method to render. Known values from HttpMethodName get a dedicated color via HTTP_METHOD_COLOR; any other string renders in slate as the "Other" fallback (the text itself is shown verbatim).
size"small" | "medium" | "large" | null | undefinedmediumBadge size — defaults to medium.
titlestring | undefined
defaultCheckedboolean | undefined
defaultValuestring | number | readonly string[] | undefined
autoFocusboolean | undefined
idstring | undefined
tabIndexnumber | undefined
relstring | undefined
onChangeChangeEventHandler<T, Element> | undefined