Browse documentation

Component

Badge

Badges provide compact labels for status, categorization, and lightweight emphasis.

Preview

StableCommunityPreviewOpen SourceAction needed

Installation

Packages are unreleased. Follow the packed artifact setup for package mode, or run the local CLI in copy mode and complete the reported npm, token CSS, and Tailwind setup.

Copy Badge · bash
pnpm exec ui add badge
Full installation guide

Usage

This example uses package mode. In copy mode, import the generated component from your project and complete the manual setup steps in the installation guide.

Badge example · tsx
import { Badge } from '@nimjs/ui';

export function Example() {
  return (
    <div className="flex gap-2">
      <Badge>Stable</Badge>
      <Badge variant="secondary">Community</Badge>
      <Badge variant="outline">Docs</Badge>
      <Badge variant="destructive">Action needed</Badge>
    </div>
  );
}

System metadata

Guidance

Badges should stay short and scannable. Use destructive for urgent status and keep actions in buttons or links. A ref can target the underlying span.