Badge
useBadge(options) creates a <span class="badge">; badgeClass(options)
returns the classes for SSR markup.
Variants
Section titled “Variants”import { useBadge } from "@katanakit/ui";
row.append( useBadge({ label: "Draft" }), useBadge({ label: "Info", variant: "info" }), useBadge({ label: "Paid", variant: "success" }), useBadge({ label: "Pending", variant: "warning" }), useBadge({ label: "Failed", variant: "danger" }),);Options
Section titled “Options”| Option | Type | Default | Notes |
|---|---|---|---|
label |
string |
"" |
Badge text. |
variant |
"neutral" | "info" | "success" | "warning" | "danger" |
"neutral" |
Semantic color. |
::: tip Dark mode
Variants use KatanaKit palette tokens, so they invert automatically with
data-theme="dark" (toggle the site theme to see it).
:::