Klarhimmel UI

Badge

Stable

A short label for status or category.

npx shadcn add @klarhimmel/badge

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
badge.tsx
import { Theme } from '@/components/klarhimmel/theme/style';
import { Badge } from '@/components/klarhimmel/ui/badge';

export default function Example() {
  return (
    <Theme theme="brand">
      <Badge tone="accent">New</Badge>
    </Theme>
  );
}

Install

Import

import { Badge } from '@/components/klarhimmel/ui/badge';
Lands in
components/klarhimmel/ui/badge.tsx, plus cn() and the theme item if they are missing. Import theme.css after Tailwind.
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.

API reference

PropTypeDefaultDescription
tone'neutral' | 'accent' | 'outline''neutral'Visual weight.
childrenReactNode-Required. The label.
classNamestring-Extra classes, merged after the component's own.

Accessibility

KeyDoes
TabSkips it: a badge is text, not a control

Do not rely on the colour alone. The word carries the meaning.

Accessibility