structyl

The full prop reference for the Badge component. A small visual indicator for statuses, counts and labels.

Import

tsx
import { Badge } from '@structyl/styled';

Props

Badge

A styled badge component with variant styling, optional dot indicator, icons, and removable functionality

PropTypeDefault
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#boolean

If true, renders children as the component element (Slot composition)

dot#boolean

If true, renders a status dot before label text

icon#React.ReactNode

Icon element shown before label text

removable#boolean

If true, shows a remove button that calls onRemove when clicked

onRemove#(e: React.MouseEvent) => void

Callback fired when remove button is clicked

className#string

Additional CSS classes to merge with component styles

children#React.ReactNode

Badge label text or content

Source code

If you didn't find what you need here, read the component implementation .

structyl — Accessible React Component Library