Trivela UI

Badge

Displays a small pill of status or metadata, with variant and color token support.

Active

Usage

badge-demo.tsx
import { Badge } from 'trivela-ui';

export function Example() {
  return <Badge color="success">Active</Badge>;
}

Examples

Variants

Four style variants share the same pill shape and text size.

solidoutlineghostsubtle

Colors

Every variant accepts the full color scale.

primarysecondarysuccesswarningdangerinfoneutral

Status list

Colors carry meaning, so map each status onto the matching token.

api-server-deployedDeployed
api-server-pendingPending
api-server-failedFailed

API Reference

PropTypeDefaultDescription
variant'solid' | 'ghost' | 'outline' | 'subtle''solid'Style variant for the component.
color'primary' | 'secondary' | 'success' | 'warning' | 'danger' | 'info' | 'neutral''neutral'Color scale used by the component.
size'sm' | 'md' | 'lg''md'Padding and text size.
classNamestringMerged with the generated classes via cn().
...propsHTMLAttributes<HTMLSpanElement>All native attributes are forwarded to the root element.