Badge
New
npx shadcn add @klarhimmel/badgeCopy for AIDetailsAbout, usage, props and more
A short label for status or category.
When to use
Use for
One or two words of status or category.
Not for
Actions. A badge is never a button.
Pairs with
Cards, table rows, headers.
Preview
NeutralAccentOutline
Import
Import
- Files
- badge.tsx, in components/klarhimmel/ui/. With it: theme, utils.
- Render in
- Render it inside <Theme>, once near the root of your app. Tokens and fonts are scoped to it, so outside it the component is unstyled.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
tone | 'neutral' | 'accent' | 'outline' | 'warning' | 'danger' | 'neutral' | Visual weight; warning and danger for a priority, a near date, urgent. |
children | ReactNode | required | Required. The label. |
className | string | - | Extra classes, merged after the component's own. |
Accessibility
| Key | Does |
|---|---|
Tab | Skips it: a badge is text, not a control |
Do not rely on the colour alone. The word carries the meaning.
Accessibility