Weftv0.4.0
GitHubFigma
Blade AI
Display · Indicatorstable

Indicator

A small coloured dot with an optional label that shows status at a glance. Five intents and three sizes. Without a label the dot stands alone and needs an accessible name.

Preview

#preview

Change the options and the code follows. Show code opens the React snippet.

Active
indicator-example.tsx
import { Indicator } from "@blade-ai/weft/components/indicator";

<Indicator>Active</Indicator>

All states

#all-states

Every intent, three sizes and a label-less dot, from the Indicator artboard.

Indicator · 5 intents · 3 sizes · label-less
Positive
positive
Negative
negative
Notice
notice
Information
information
Neutral
neutral
Active
Size · small
Active
Size · medium
Active
Size · large
Label-less dot

Props

#props

Read from the component source. Booleans are is-prefixed. A star marks a required prop.

Prop
Type
Default
Description
intent
"positive" | "negative" | "notice" | "information" | "neutral"
"neutral"
Meaning of the dot; sets its colour.
size
"small" | "medium" | "large"
"medium"
Dot 6 / 8 / 10px with a 12 / 14 / 16px label.
children
ReactNode
—
Text beside the dot. Without a label the dot stands alone and needs accessibilityLabel.
accessibilityLabel
string
—
Accessible name for a label-less dot (e.g. "3 unread"). Ignored when there is a label.

Usage

#usage

Short rules for choosing and writing indicator.

Do
Map each status to one intent across the product.
Add a text label whenever there is room.
Give a label-less dot an accessibilityLabel such as "3 unread".
Don't
Use colour alone to carry the meaning.
Use an indicator as a button.
Mix sizes in the same list.

Accessibility

#accessibility

The label carries the meaning; a lone dot is named with accessibilityLabel.

ARIA
Element
Role / attribute
When
Indicator with label
text
The dot is decorative.
Label-less indicator
role="img" · aria-label = accessibilityLabel
Required, because a dot alone has no text.
Colour
never alone
Keep the text label so status survives without colour.