structyl

Badge

stable

A small visual indicator for statuses, counts and labels.

Basic usage

DefaultSecondarySuccessWarningDestructive

Examples

Status indicators

Show all five semantic variants to communicate pipeline or task status.

DefaultDraftPublishedPendingFailed

Status variants

Badges cover neutral labels, success, warning, destructive and outline statuses.

DefaultSecondaryOutlineHealthyReviewBlocked

Color prop

The color prop applies semantic tints to both filled and outline shapes.

primarysecondaryerrorwarninginfosuccess
primarysecondaryerrorwarninginfosuccess

Features

  • Six variants.
  • Supports `asChild`.

Installation

bash
pnpm dlx structyl add badge

API Reference

Badge

A small status descriptor. Renders a span by default.

PropTypeDefault
variant'default' | 'secondary' | 'destructive' | 'outline' | 'success' | 'warning'

Visual style.

'default'
asChildboolean

Merge props onto the immediate child instead of rendering a default element.

false
classNamestring

Additional Tailwind classes, merged with the component defaults.

Badge | structyl