Skip to content
Components / Collections

Badge

A short status that always has a text label.

@fabrials/ui
Loading state
DraftCurrentStaleFailedPreview
Synced3 h oldExpiredPaused
MITv0.9.0New12
TravelTravel, archivedA label that is far too long for its row

Installation

  1. Import the control from @fabrials/ui, after setting the app up.

    TypeScript
    import { Badge } from "@fabrials/ui";

API reference

Prop / exportTypeDescription
toneneutral | info | success | warning | dangerColor is paired with the word.
variantsoft | outline | solidsoft for status, outline for facts such as a license or version, solid for a count that must stand out.
dotboolean | hollowA square marker before the text, like one pixel of the dither. hollow is an outline dot for an archived or inactive item.
dotColorstringColours the dot alone with any CSS colour (var(--label-tone)); it sets --fui-badge-dot.
truncatebooleanThe tag shrinks to its container and cuts long text with an ellipsis; the full text goes to the title. --fui-badge-max caps the width.
--fui-badge-solid / --fui-badge-inkCSS propertiesPublic. A tag whose colour is data sets --fui-badge-solid (tint, hairline, dot) and, if needed, --fui-badge-ink (text) on the badge itself (a class or style, not an ancestor); tones only set their defaults.

Behavior

A small tag with 3 px corners, never a pill. Color is not the only signal: the text says what the status is. A data colour tints the tag while the ink stays neutral, so the name reads on any colour.

Accessibility

Keyboard and contrast
Keep visible labels, keyboard focus and status announcements when customizing. These components inherit your theme; maintain sufficient contrast in both color modes. The preview is keyboard operable.