Dot

A small status or colour mark: a light that says live, recording or away, or a swatch that says which department or which paint. Tones re-theme; a free colour comes straight from your data.

REC 00:12:43 On duty 1-ADAM-12 Patrol sedan

Installation#

# One-time setup (tokens + lib helpers)npx koalaui-cli@latest init# Add this component (its dependencies come along)npx koalaui-cli@latest add dot

Usage#

usage.tsxTSX
import { Dot } from "@/components/ui/dot"export function Example() {  return (    <span className="inline-flex items-center gap-2">      <Dot tone="success" /> Online    </span>  )}

Anatomy#

import { Dot } from "@/components/ui/dot"<Dot />

Tones#

A tone takes its colour from a semantic role, so it re-themes across all four themes with the rest of the system. neutral is the default (the muted ink, for offline or idle), and current follows the text colour around it.

neutral brand success warning info destructive purple pink teal orange

Free colour#

When the colour comes from data (a department, a call category, a team), pass it as color: any CSS colour, hex, rgb(), hsl() or a var(). It overrides tone, and the halo of a ping follows it too.

Shapes#

round is a status light. square is a swatch, a small rounded square for a colour that identifies something rather than describes its state: the department beside a callsign, the paint of a vehicle. Its corner is a quarter of its side at every size, so it never rounds into a circle.

Available 4-LINCOLN-7

Sizes#

xs 6px for dense rows and inside chips, sm 8px (the default) beside body text, md 10px for a swatch or a light that has to be seen from across the screen.

Ring#

A white or pale colour vanishes on a white card. ring lays a hairline over the edge (black at low alpha in the light themes, white in the dark ones), inside the box, so the dot keeps its size. Turn it on whenever the colour comes from data and could be light.

No ring White Pale yellow Black

Pulse#

blink is a recording light: one second on, one second off, the cadence a camera or a bodycam uses for “REC”. ping sends a halo out of the dot, the signal for live, on air or on duty. Both stand down under reduced motion: the blinking dot stays lit and the halo is not drawn, so the state still reads, it just holds still.

REC Live On air

In a roster#

The two shapes side by side: a square for who the unit belongs to, a round light for what it is doing. The department colours are plain hex strings from the data, ringed because one of them is nearly white.

  • 1-ADAM-12 Available
  • 4-LINCOLN-7 En route
  • 2-KING-31 On scene
  • 9-MARY-4 Off duty

Accessibility#

Without a label the dot is decorative (aria-hidden): the text beside it says the same thing, so it is announced once. With a label it becomes an image named by it (role="img"), for a mark that carries meaning nothing else on screen spells out, such as the department square beside a callsign. Never let colour be the only signal: pair a status light with its word, or give the dot a label.

Away 2-KING-31

API reference#

Dot

A <span>, the mark itself. Every other <span> prop passes through (but children and color, which is the prop below); className is merged last.

PropTypeDefaultDescription
tone"neutral" | "brand" | "success" | "warning" | "info" | "destructive" | "purple" | "pink" | "teal" | "orange" | "current""neutral"The colour, from a semantic role, so the dot re-themes. current follows the text colour around it.
colorstring-Any CSS colour ("#1d4ed8", "rgb(220 38 38)", "var(--x)"). Overrides tone; for colours that come from data.
shape"round" | "square""round"round is a status light; square a swatch, with a quarter-radius at every size.
size"xs" | "sm" | "md""sm"6, 8 or 10px. A size-* utility in className overrides it.
ringbooleanfalseA hairline over the edge, so pale colours read on pale grounds. Never changes the size.
pulse"none" | "blink" | "ping""none"blink is 1s on, 1s off; ping sends out a halo. Both hold still under prefers-reduced-motion. Backed by the --animate-blink and --animate-live-ping tokens.
labelstring-The accessible name. With it the dot is role="img"; without it, aria-hidden, so the text beside it carries the meaning.
Data attributeDescription
data-slot"dot".
data-toneThe tone ("neutral" when unset). Absent when a color is given.
data-pulse"blink" or "ping". Absent when the dot holds still.
CSS variableDescription
--dot-colorThe one colour the fill and the halo both read. Written by tone, or inline by color.

FAQ#

A Badge with `dot` is a chip: the light plus a label, in one bordered pill. Reach for Dot on its own when the label is already there in your layout (a table cell, a list row, a callsign) and the chip's border and padding would be noise.