Badge

Displays a stylized badge element.

Badge
PropTypeDefault
color"gray" | "purple" | "blue" | "green" | "yellow" | "red""gray"
highContrastboolean
size"1" | "2""1"

This component is based on the span element and supports common margin props m, mx, my, ml, mr, mt, mb. View source

Use the color prop to control the color of the badge.

GrayPurpleBlueGreenYellowRed

Use the highContrast prop to control whether a higher contrast color combination is used.

GrayGray

Use the size prop to control the size of the badge.

Size 1Size 2Size 2

You can compose Badge together with the Code component.

HTTP

Use the following Badge colors and Code component to represent HTTP response codes:

200401500

Use the following Badge colors and Code component to represent HTTP request methods:

GETPOSTPUTDELETE