Skip to content

Badge - Frameworks

Badges are used to highlight a relevant piece of information, like status or category.

AndroidreleasedElementsreleasediOSreleasedReactreleasedVuereleased

React

Import

You can import the component like so:

js
import { Badge } from '@warp-ds/react';

or import it individually to optimize your JS bundle size by adding only the components you need:

js
import { Badge } from '@warp-ds/react/components/badge';

Syntax

jsx
<Badge>Default badge rendered as neutral variant</Badge>
<Badge variant="info">Info variant badge</Badge>
<Badge variant="price" position="top-left">Price badge with a top-left position</Badge>

Props

Optional Props

NameTypeDefaultDescription
asstringdivThe DOM element to emit
variant'neutral', 'info', 'positive', 'warning', 'negative', 'disabled', 'price', 'sponsored''neutral'
position'top-left', 'top-right', 'bottom-right', 'bottom-left'undefinedUsed for absolute positioning of the badge within a container
childrenElement | Element[] | stringContent of the Badge component
classNamestringAdditional CSS classes to apply to the component
styleCSSPropertiesCSS styles to inline on the component

Questions?

Feel free to ask any questions on usage in the Warp DS Slack channel: #warp-design-system