Skip to content

Components

Badge

Shows a short status or category as a native span.

Customize
Ombelle · light

Installation

Run in a project initialized with an Ombelle preset (see Get started). The component uses the saved project preset. Run the command from your app folder; it shows the changes and asks before writing.

pnpm dlx @ombelle-ui/cli@1.1.2 add badge

Adds components/ui/badge.tsx and installs react, clsx, tailwind-merge with lifecycle scripts disabled.

In a liquid glass project the plan adds a notice that accessibility is not guaranteed, because text contrast depends on the background behind the glass.

Usage

example.tsx
import { Badge, BadgeDot } from '@/components/ui/badge'

export function Status() {
  return <>
    <Badge>Synced</Badge>
    <Badge variant="destructive">Needs attention</Badge>
    <Badge size="sm"><BadgeDot />Active</Badge>
  </>
}

API and states

API
variant (default, secondary, outline, accent, destructive, success, warning, info), appearance (solid, soft, outline), size (sm, default), BadgeDot, className
Minimum states
Default, secondary, outline, accent, destructive, success, warning, info; soft and outline appearances; small and default sizes; optional status dot
Native basis
<span>; interactive tags need a real button or link
Styles
Stable in Ombelle, Papier, Organic, Retro futurism, minimalist, neo-brutalism and flat, light and dark. Liquid glass: stable, accessibility not guaranteed.