AsterUIDocsv1.0.2

Docs / Component reference

Badge

Give a short state, such as a review outcome, a label that fits beside the item it describes.

Badge example

Install

sh
npx @fierst/ui@1.0.2 add badge

Registry dependencies: theme.

Exports from ./ui/badge: BadgeTone, Badge.

Download the registry source for badge 1.0.2.

API contracts

ts
export type BadgeTone = 'neutral' | 'primary' | 'success' | 'warning' | 'danger';

export function Badge({
  tone = 'neutral',
  dot = false,
  class: extraClass,
  children,
  ...rest
}: {
  tone?: BadgeTone;
  dot?: boolean;
  class?: string;
  children?: View;
  [key: string]: any;
})