Dinachi

Badge

A small visual indicator for labeling, categorizing, or displaying status information.

#Installation

npx @dinachi/cli@latest add badge

#Usage

tsx
import { Badge } from '@/components/ui/badge'

#Examples

Default Badge

A basic badge

Badge

Badge Variants

Different badge variants for various contexts

Default
Secondary
Destructive
Outline
Success
Warning
Info

Badge Sizes

Badges in different sizes

Small
Default
Large

#API Reference

PropTypeDefaultDescription
variant'default' | 'secondary' | 'destructive' | 'outline' | 'success' | 'warning' | 'info''default'The visual style variant of the badge
size'sm' | 'default' | 'lg''default'The size of the badge
rounded'default' | 'sm' | 'md' | 'lg' | 'none''default'The border radius of the badge
renderReactElementCustom render prop for composition (Base UI pattern)
interactivebooleanfalseWhether the badge should be interactive (clickable)
iconReactNodeIcon to display before the content
dismissiblebooleanfalseWhether to show a close button
onDismiss() => voidCallback when close button is clicked