Skip to content

Spinner

widgetsfeedback

Spinner: animated loading indicator

Installation

$ bunx termuijs add spinner

Copies the source into src/components/spinner/ and installs @termuijs/core, @termuijs/motion, @termuijs/widgets.

Usage

ts
import { Spinner } from '@termuijs/widgets'
ts
new Spinner(style: Partial<Style> = {}, options: SpinnerOptions = {})

API Reference

Spinner

PropTypeRequiredDescription
spinnerstring | { frames: string[]; interval: number }optionalSpinner preset name or custom frames
presetstringoptionalSpinner preset name (preferred option)
variantstringoptionalAnimation variant (dots, line, braille, etc.)
labelstringoptionalText label displayed after the spinner
colorColoroptionalColor for the spinner frames
activebooleanoptionalWhether the spinner is active/animating (default: true)
doneTextstringoptionalText to display when active is false (e.g., '✓ Done')
intervalnumberoptionalCustom frame interval in milliseconds
#feedback#spinner