Indicator
Count or dot badge anchored on any element
A small square plate pinned to a corner of whatever it wraps: a count on an inbox button, a presence dot on an avatar. value as a number shows the count (max, default 99, turns 120 into "99+"). true shows a dot. 0 or false hides it. position names a physical corner and stays put in RTL, like every side-named prop. inline is on by default for icons and buttons. Turn it off to wrap a block.
Give it a label that says what the number means ("3 unread", "online"), and keep it in step with value. A status region that stays in the page reads it, so a change is announced in full ("4 unread", not "4"). This includes a change that appears from zero. Without a label, the badge is decorative and hidden from screen readers, because a bare "3" read after a button name means nothing. For a label that sits in the text rather than on a corner, use Badge.
Usage
import { BlessIndicator } from "blessing-ui";API
Props
| Name | Type | Default | Description |
|---|---|---|---|
value | number | boolean | — | number → count badge, true → dot, falsy → hidden |
max | number | 99 | |
color | "text" | "accent" | "danger" | "warning" | "success" | "info" | "text" | |
position | "top-end" | "top-start" | "bottom-end" | "bottom-start" | "top-end" | |
inline | boolean | true | wrapped element is inline (icon) vs block |
label | string | — |
Slots
| Name | Scope | Description |
|---|---|---|
default | — |