docs/components/display/Badge

Badge

Status and count label with variants.

import { Badge } from '@ybouhjira/hyperkit';

#Playground

Edit the code — the preview recompiles and re-renders as you type.

Live playground
Loading preview…

#More Examples

Success

<Badge variant="success">Active</Badge>

Warning

<Badge variant="warning">Pending</Badge>

#Props

PropTypeDefaultDescription
variant'default' | 'success' | 'warning' | 'danger' | 'info' | 'outline' | 'soft''default'Color variant for the badge.
size'xs' | 'sm' | 'md' | 'lg''md'Size variant. Controls height, padding, and font-size via tokens.
type'label' | 'dot' | 'count''label'Badge display type.
countnumberNumeric count to display when type is 'count'.
maxCountnumber99Maximum count value before showing plus sign.
childrenJSX.ElementLabel content to display when type is 'label'.
classstringAdditional CSS class name.
styleJSX.CSSPropertiesInline CSS styles to apply.
unstyledbooleanfalseDisable default styling and apply only custom classes.

#Design Tokens

This component reads the following CSS custom properties. Override them globally or per-instance to restyle it — see the CSS Variables guide.

  • --sk-accent
  • --sk-badge-font-size
  • --sk-badge-font-weight
  • --sk-badge-radius
  • --sk-bg-tertiary
  • --sk-border
  • --sk-error
  • --sk-font-size-base
  • --sk-font-size-sm
  • --sk-font-size-xs
  • --sk-icon-lg
  • --sk-info
  • --sk-space-2xs
  • --sk-space-md
  • --sk-space-px
  • --sk-space-sm
  • --sk-space-xs
  • --sk-success
  • --sk-text-muted
  • --sk-text-primary
  • --sk-text-secondary
  • --sk-warning