Components · Content
Badge
A small status label with a tone: neutral (default), info, success, warning, danger, or accent (the accent color: the theme's accent, or blue on the default palette; for a label that is not a status). variant: soft (default), solid, or outline. icon puts an icon by name (see Icon) before the label. dot: "start" puts a small status dot in the tone before the label; dot: "only" shows the dot alone (an unread mark), and the label is then read by screen readers only; it takes no icon or variant.
ExamplesLink to this section
Show JSONHide JSON
{
"version": 1,
"root": "stack",
"elements": {
"stack": {
"type": "Stack",
"props": { "direction": "horizontal", "gap": "sm" },
"children": ["neutral", "info", "success", "warning", "danger", "accent"]
},
"neutral": { "type": "Badge", "props": { "label": "draft" } },
"info": { "type": "Badge", "props": { "label": "beta", "tone": "info" } },
"success": {
"type": "Badge",
"props": { "label": "shipped", "tone": "success" }
},
"warning": {
"type": "Badge",
"props": { "label": "at risk", "tone": "warning" }
},
"danger": {
"type": "Badge",
"props": { "label": "blocked", "tone": "danger" }
},
"accent": {
"type": "Badge",
"props": { "label": "featured", "tone": "accent" }
}
}
}Show JSONHide JSON
{
"version": 1,
"root": "stack",
"elements": {
"stack": {
"type": "Stack",
"props": { "direction": "horizontal", "gap": "sm" },
"children": ["soft", "solid", "outline", "rated"]
},
"soft": { "type": "Badge", "props": { "label": "soft", "tone": "info" } },
"solid": {
"type": "Badge",
"props": {
"label": "solid",
"tone": "success",
"variant": "solid",
"icon": "check"
}
},
"outline": {
"type": "Badge",
"props": { "label": "outline", "tone": "warning", "variant": "outline" }
},
"rated": { "type": "Badge", "props": { "label": "4.8", "icon": "star" } }
}
}A dot alone is an unread mark: screen readers hear its label.
Inbox
Unread messagesShow JSONHide JSON
{
"version": 1,
"root": "row",
"elements": {
"row": {
"type": "Box",
"props": { "direction": "horizontal", "align": "center", "gap": "sm" },
"children": ["online", "live", "inbox", "unread"]
},
"online": {
"type": "Badge",
"props": { "label": "Online", "tone": "success", "dot": "start" }
},
"live": {
"type": "Badge",
"props": {
"label": "Live",
"tone": "danger",
"variant": "solid",
"dot": "start"
}
},
"inbox": { "type": "Text", "props": { "text": "Inbox", "size": "sm" } },
"unread": {
"type": "Badge",
"props": { "label": "Unread messages", "tone": "info", "dot": "only" }
}
}
}PropsLink to this section
Generated from the zod schema the server validates with. Unknown props are ignored with a warning. Any prop can also be a dynamic value such as { "$state": "/path" }; it is checked again once it resolves.
| Prop | Type | Limits and defaults |
|---|---|---|
| labelrequired | string | max 60 chars |
| tone | "neutral" | "info" | "success" | "warning" | "danger" | "accent" | — |
| variant | "soft" | "solid" | "outline" | — |
| icon | "file-text" | "notes" | "notebook" | "book" | "book-2" | "writing" | "pencil" | "feather" | "quote" | "report" | "presentation" | "clipboard" | "archive" | "folder" | "paperclip" | "link" | "checklist" | "list-check" | "clipboard-list" | "clipboard-check" | "list-details" | "map" | "route" | "target" | "flag" | "compass" | "timeline" | "sitemap" | "hierarchy" | "gavel" | "scale" | "rocket" | "bulb" | "brain" | "search" | "microscope" | "flask" | "school" | "atom" | "language" | "code" | "terminal-2" | "brackets" | "git-branch" | "git-pull-request" | "git-merge" | "api" | "bug" | "puzzle" | "plug" | "tool" | "settings" | "adjustments" | "components" | "layout-dashboard" | "robot" | "package" | "database" | "server" | "cloud" | "cpu" | "table" | "chart-bar" | "chart-line" | "chart-pie" | "chart-dots" | "trending-up" | "stack-2" | "versions" | "calendar" | "calendar-event" | "clock" | "hourglass" | "alarm" | "refresh" | "lock" | "key" | "shield" | "shield-check" | "fingerprint" | "eye" | "users" | "user" | "message-circle" | "mail" | "bell" | "speakerphone" | "lifebuoy" | "circle-check" | "alert-triangle" | "info-circle" | "help-circle" | "ban" | "bolt" | "flame" | "sparkles" | "star" | "heart" | "trophy" | "home" | "building" | "briefcase" | "currency-dollar" | "shopping-cart" | "world" | "palette" | "photo" | "device-laptop" | "device-mobile" | "coffee" | "leaf" | "arrow-right" | "arrow-left" | "arrow-up-right" | "chevron-right" | "chevron-left" | "chevron-down" | "chevron-up" | "check" | "x" | "plus" | "minus" | "menu-2" | "dots" | "external-link" | "download" | "upload" | "send" | "player-play" | "trash" | "copy" | "filter" | "share" | "bookmark" | "tag" | "at" | "phone" | "map-pin" | "credit-card" | "gift" | "truck" | "thumb-up" | "login" | "logout" | "sun" | "moon" | "brand-github" | "brand-gitlab" | "brand-x" | "brand-linkedin" | "brand-youtube" | "brand-instagram" | "brand-facebook" | "brand-tiktok" | "brand-discord" | "brand-mastodon" | "brand-bluesky" | "brand-threads" | "brand-reddit" | "brand-twitch" | "brand-dribbble" | "brand-behance" | "brand-medium" | "brand-apple" | "brand-google" | "brand-windows" | "brand-android" | — |
| dot | "start" | "only" | — |
RulesLink to this section
tone: neutral (default), info, success, warning, danger, or accent. The status tones mean a state; accent is the accent color (the theme's own accent, or blue on the default palette), for a label that is not a status (New, Featured). Every tone reads in every variant on every Box surface and in every theme.dot: "start"draws a small dot in the tone before the label.dot: "only"draws the dot alone and keeps the label for screen readers, so the label must say what the dot means ("Unread messages"). A dot alone takes noiconorvariant: it has no pill for them to style.
Children and eventsLink to this section
Badge is a leaf: it does not show children. Validation warns when a leaf has some; wrap them in a Stack or Card instead.
It emits no events.