StatusDot
An 8px dot showing a state, gray when there is none. It is a role="img" named by label, and working replaces the dot with an animated glyph in the state’s color.
<StatusDot state="success" label="Online" /><StatusDot variant="hollow" label="Not started" /><StatusDot state="danger" variant="hollow" working label="Reconnecting" /><StatusDot
state="success"
variant="solid"
working={false}
label="Online"
/>statepicks the color:info,warning,success,danger, ordisabled. Leave it out for the gray dot.variant="hollow"draws a ring in the state’s color with no fill.<StatusDot variant="hollow" label="Not started" />is the gray ring.workingreplaces the dot with an animated glyph in the state’s color on the same 8px box, so a change never shifts the layout.labelis the accessible name, so always give one. A sighted viewer sees only the color, so pair the dot with visible text or a tooltip that shows the label.
States
Section titled “States”Solid
no state
info
warning
success
danger
disabled
Hollow
no state
info
warning
success
danger
disabled
Working
no state
info
warning
success
danger
disabled
In a tooltip
Section titled “In a tooltip”A dot is not focusable by itself. Give it tabindex="0" inside Tooltip.Trigger so keyboard users reach the tooltip, and keep the label as its aria-label.
Code
<script lang="ts"> import { StatusDot, Tooltip } from "@viamrobotics/prime-ui";</script>
<div class="not-content"> <Tooltip> <Tooltip.Trigger class="inline-flex"> <StatusDot state="success" label="Online" tabindex={0} class="focus-ring" /> </Tooltip.Trigger> <Tooltip.Content placement="right">Connected 2 minutes ago</Tooltip.Content> </Tooltip></div>Styling
Section titled “Styling”class lands on the dot, which wears the status-dot component class and one status-dot-<state> modifier. See Component classes for the plain HTML form.
Keyboard
Section titled “Keyboard”The dot is not interactive, so it takes no keys. With tabindex="0" it becomes a tab stop, which opens a tooltip around it.
| Prop | Type | Default | Description |
|---|---|---|---|
state | StatusDotState | Which state to show. Leave it out for the gray dot. | |
variant | StatusDotVariant | 'solid' | hollow draws a ring in the state's color with no fill. |
working | boolean | false | Replaces the dot with an animated glyph in the state's color, on the same 8px box. |
label | string | The accessible name. A dot has no text of its own, so this is required. |
Plus everything in HTMLAttributes<HTMLSpanElement>, spread onto the element.