Display
Badge
Count and status indicators anchored to icons and avatars, plus an inline tone pill with a status dot for text rows.
<script>
import { Badge, IconButton } from "@codeatlasdev/ui";
</script>
<Badge count={3}><IconButton aria-label="Messages">…</IconButton></Badge>
Badge wraps its child and positions the indicator on the corner. Pass count for a number (hidden at 0, capped at 99+) or dot for a plain status dot. The indicator is a role="status" element labelled “New” (dot) or “N notifications” (count) from the i18n catalog; still give the wrapped control its own accessible name.
Dot and counts
`dot` shows a plain indicator, `count` shows a number capped at `99+`.
Reference #113 · Pick in the gallery
Code
On avatars
Status dots on avatars.
Reference #114 · Pick in the gallery
Code
Colors
brand, success, warning and error.
Reference #112 · Pick in the gallery
Code
Status pill in a text row: tone. <Badge tone="danger" subtle dot size="md">Overdue</Badge> renders an inline pill in text flow (its children are the label) instead of a corner indicator: 24px high at md (20px at sm), a 6px dot with dot, and with subtle a translucent tinted background whose label clears 4.5:1 in light and dark. Tones: brand, success, danger, warning, info, neutral. The dot is decorative: the label carries the meaning, so never rely on colour alone. Do not write a .overdue class with color-mix and a .dot span. For a status with a fixed vocabulary and no dot, StatusChip is still fine.
Inline pill
`tone` + `subtle` + `dot` next to a title in a list row.
- Call back Marina Costa Overdue
- Send contract to Atlas Logistics Due today
- Review quote #4821 Done
- Intro email, Orion Tech Draft
Reference #900 · Pick in the gallery
Code
Props
| Prop | Type | Default | Description |
|---|---|---|---|
count | number | undefined | Number to display. Hidden when 0 or undefined unless `dot` is set. Values above 99 render as `99+`. |
dot | boolean | false | Anchored: shows a dot instead of a number. With `tone`: a 6px leading dot inside the pill. |
color | 'brand' | 'success' | 'error' | 'warning' | 'brand' | Anchored indicator colour. Ignored when `tone` is set. |
tone | 'brand' | 'success' | 'danger' | 'warning' | 'info' | 'neutral' | undefined | Renders an inline pill (`ca-badge--inline`) in text flow; children are its label. `danger` is the error semantic. |
subtle | boolean | false | Pill only: translucent tinted background with a tone-coloured label (`ca-badge--subtle`) instead of a solid fill. |
size | 'sm' | 'md' | 'sm' | Pill only: 20px (`sm`) or 24px (`md`) high. |
class | string | '' | Extra class names. |
children | Snippet | undefined | The element the badge is anchored to. |