Components
Badge
Badge positions itself absolutely against its parent, so every story wraps it in a relatively-sized box — on its own it has nothing to anchor to.
This example is composed with Storybook args. Open the interactive workbench to change its props and inspect the generated API controls.
Import
import { Badge } from '@simal/ui/nativewindui';Props
| Prop | Values | Default | Description |
|---|---|---|---|
children | — | "3" | The count. Omit it entirely and the badge collapses to a bare dot. |
variant | destructive · info | "destructive" | destructive (the default) for anything needing attention, info for the primary colour. |
maxCount | — | — | Counts above this render as {maxCount}+, so the pill cannot grow without bound. |
textVariant | — | — | Text scale for the count. Defaults to caption2. |
containerClassName | — | — | Classes for the pill itself. className goes to the count text, not the container. |
Examples
Dot
With no children it collapses to a bare dot — an unread marker.
Overflow
Counts above maxCount render as {maxCount}+.