Skip to content

Count

A notification number / badge that clamps to max (“N+”) with an optional dot mode for presence indicators.

<script>
import Count from "@invisible-ui/svelte/Count.svelte";
</script>
PropTypeDefaultDescription
countnumber0The value to show.
maxnumber99Clamp threshold (e.g. 128 → 99+).
dotbooleanfalseRender a dot instead of a number.
showZerobooleanfalseRender when count is 0.
statusCountStatus"danger"Color.
labelstring | undefinedundefinedAccessible description (e.g. "unread messages").
  • Pass label so the number is announced with meaning (e.g. “5 unread messages”).
  • The number reaches 4.5:1 on every status fill. Warning paints --ds-components-general-feedback-warning-label-background-default under the dark --ds-components-general-feedback-warning-solid-foreground-default, 4.71:1 in both themes.
<Count count={128} max={99} label="notifications" />
<ds-count count="128" max="99" label="128 notifications"></ds-count>

In React:

<Count count={128} max={99} label="128 notifications" />

Themeable via --ds-count-*.