Badge API
View componentThe full prop reference for the Badge component. A small visual indicator for statuses, counts and labels.
Import
import { Badge } from '@structyl/styled';Props
Badge
A styled badge component with variant styling, optional dot indicator, icons, and removable functionality
| Prop | Type | Default |
|---|---|---|
| variant# | 'default' | 'secondary' | 'destructive' | 'outline' | 'success' | 'warning' | 'info' | 'error'Badge visual style variant | 'default' |
| color# | 'primary' | 'secondary' | 'error' | 'warning' | 'info' | 'success' | 'default'Color scheme when combined with variant; affects text and border colors | — |
| size# | 'sm' | 'md' | 'lg'Badge size with padding and text size adjustments | 'md' |
| asChild# | booleanIf true, renders children as the component element (Slot composition) | — |
| dot# | booleanIf true, renders a status dot before label text | — |
| icon# | React.ReactNodeIcon element shown before label text | — |
| removable# | booleanIf true, shows a remove button that calls onRemove when clicked | — |
| onRemove# | (e: React.MouseEvent) => voidCallback fired when remove button is clicked | — |
| className# | stringAdditional CSS classes to merge with component styles | — |
| children# | React.ReactNodeBadge label text or content | — |
Source code
If you didn't find what you need here, read the component implementation .