Skip to Content
ink-ui

⏳ Spinner

Animated spinner in accent colour, in five one-cell styles, with an optional dimmed label.

<Spinner> renders an animated spinner in the accent colour, with an optional dimmed label beside it. It ticks on Ink's shared useAnimation clock, so several spinners cost one timer, and holds a still frame when stdout is not a TTY or NO_MOTION / REDUCE_MOTION is set.

import { Spinner } from "@kud/ink-ui";

Props

PropTypeDefaultDescription
labelstringβ€”Optional text rendered beside the spinner
type"dots" | "line" | "arc" | "pulse" | "bounce""dots"Glyph cycle; every style is one cell wide
animatebooleantruefalse holds the still frame

The spinner glyph is coloured with colors.accent (#FF8C00).

Examples

<Spinner label="Building…" />
<Spinner />
<Spinner type="arc" label="Fetching…" />

On this page