Skip to content

Badge

Displays a badge or a component that looks like a badge.

Badge

Install

Bash
npx @madeui/cli add badge

Usage

TSX
import { Badge } from '@/components/ui/badge';

<Badge variant="outline">Badge</Badge>

Variants

SecondaryOutlineDestructive

With icon

Verified

With spinner

Syncing

Pass a render element to render the badge as a different element, such as a link.

API reference

Badge

PropTypeDefaultDescription
variant'primary' | 'secondary' | 'outline' | 'ghost' | 'destructive''primary'Visual style.
renderReactElement | (props, state) => ReactElement—Renders the badge as a different element (e.g. an <a>) while keeping the badge styling.
styleStyleXStyles—StyleX styles merged last — always win over the component’s own styles.

Was this page helpful?