Recommended
01
Production default
Balanced spacing, hierarchy, and content for the most common product workflow.
Live preview
<Badge
label="Active"
size="sm"
color="success"
variant="soft"
/>
Theme-aware, responsive badge component.
Change any prop and inspect the server-rendered component immediately.
<Badge
label="Active"
size="sm"
color="success"
variant="soft"
/>
payload.Compare configurations and resize the browser to check responsive behavior.
Balanced spacing, hierarchy, and content for the most common product workflow.
<Badge
label="Active"
size="sm"
color="success"
variant="soft"
/>
A tighter variation for dashboards, side panels, tables, and operational interfaces.
<Badge
label="In review"
size="sm"
color="warning"
variant="outline"
/>
A more expressive variation using additional data, stronger emphasis, and optional states.
<Badge
label="Verified"
size="sm"
icon="icon-[lucide--check]"
dismissible="true"
/>
Use declarative output handlers in .wrn files or register a direct output handler from JavaScript. The canonical API exposes payload and does not require event.detail.
@dismissFires after the announcement or feedback surface is dismissed.<Badge
@dismiss='console.log(payload)'
/>import { registerOutputHandler } from "@wrnexus/csr/outputs"
const component = document.querySelector("[data-ui-component=\"Badge\"], [data-component=\"Badge\"]")
if (component) registerOutputHandler(component, "dismiss", (payload) => {
console.log("dismiss", payload)
})All content and behavior shown above is supplied through these props and slots.
| Prop | Type | Default | Required |
|---|---|---|---|
label | string | "Badge" | No |
humanize | boolean | true | No |
size | string | "md" | No |
color | string | "primary" | No |
variant | string | "solid" | No |
shape | string | "pill" | No |
class | string | "" | No |
icon | string | "" | No |
iconPosition | string | "start" | No |
dot | boolean | false | No |
dotOnly | boolean | false | No |
dotLabel | string | "Status" | No |
animated | boolean | false | No |
avatarSrc | string | "" | No |
avatarAlt | string | "" | No |
dismissible | boolean | false | No |
dismissLabel | string | "Remove badge" | No |
truncate | boolean | false | No |
maxWidth | string | "12rem" | No |
anchorLabel | string | "" | No |
anchorIcon | string | "" | No |
placement | string | "inline" | No |
anchorLabelText | string | "Badge anchor" | No |