AppBadge
A small count or label badge — the “3” on a nav item, a “New” tag beside a title.
<app-badge tone="primary">New</app-badge>A badge is a tiny inline marker — a count on a nav item, a short label like “New” or “Beta” next to a heading. It draws a small amount of attention to the thing it sits on without taking a line of its own.
<app-badge> is for counts and short labels. For a status mapped from an enum reach for <app-status-badge>. Its look comes entirely from the shared @webority/theme, so the Razor <app-badge> and the React <AppBadge> render identically on every Webority surface.
Playground
Every attribute, live. Each change re-renders the real tag helper on the server, so the markup underneath is the exact call that produced the badge above it.
Tones
Each tone carries meaning — primary to highlight, success for positive, warning to caution, danger for a problem or count that needs attention, info for neutral emphasis.
Show code
<app-badge tone="primary">Primary</app-badge> <app-badge tone="success">Approved</app-badge> <app-badge tone="warning">Needs review</app-badge> <app-badge tone="danger">Overdue</app-badge> <app-badge tone="info">Info</app-badge>
danger for an overdue count, success for an approved tag. A rainbow of tones on peer badges just adds noise.Counts & labels
The two everyday jobs: a numeric count beside a label, and a one- or two-word tag next to a title.
Show code
<span>Inbox <app-badge tone="danger">3</app-badge></span> <span>Lightning Report <app-badge tone="primary">New</app-badge></span>
When to use
Use it when
- A count sits beside a label — an unread inbox, a pending queue.
- A short static tag marks something — “New”, “Beta”, “Pro”.
- You need a tiny inline emphasis that fits on the same line as its text.
Reach for something else when
- You are showing a status mapped from an enum. → AppStatusBadge
- The token should be removable (a filter/tag). → AppChip
- It performs an action when clicked. → AppButton
- It is a persistent inline message. → AppAlert
Best practices
Every option
The whole surface of the component, one cell per value.
tone — neutral | primary | success | warning | danger | info
(none, default)tone="neutral"
tone="primary"
tone="success"
tone="warning"
tone="danger"
tone="info"
unknown tonedot
(default, no dot)dot — combined with tonecontent shape
numbershort labelempty contentclass — extra class alongside tone/dotAttributes
| Attribute | Type | Default | Description |
|---|---|---|---|
| (content) * | string | — | Badge content — a short label or a number. |
| tone | neutral | primary | success | warning | danger | info | — | Colour tone. Omit (or pass neutral) for the base badge — pick a tone for meaning. An unrecognized tone is passed through verbatim as badge-<tone>. |
| dot | bool | — | Render a leading dot before the content. |
| tooltip | string | — | A collision-aware hover/focus tooltip (Bootstrap/Popper, same engine as <app-tooltip>) that flips to stay on-screen. |
| tooltip-placement | auto | top | bottom | start | end | auto | Preferred tooltip side; auto picks the side with the most room. |