Skip to content

BbSpinner

The library's indeterminate wait, for when you cannot say how far along you are.

import { BbSpinner } from 'bitboss-ui';

On this page

Use it for

Reach for BbSpinner when something is happening and you cannot say how far along it is. A request in flight, a file being parsed, a panel with nothing to show yet.

Use something else when

  • BbProgress, when a fraction exists: bytes sent, steps completed, rows imported
  • Nothing at all: BbButton, BbTable and the form fields already carry their own loading state

Pass Through

Hover or tap a part to outline it. Toggles flip loading, errors and warnings when the component has them — only parts highlight.

Display name

Load a region or row

Use a centered spinner for an empty region and a small inline one when the rest of the row remains usable. Always name what is loading.

Recent invoices

No invoices loaded yet.

Where you no longer need one

Most waits belong to a component that already handles them. A @click handler returning a promise puts BbButton into its own loading state, BbTable has loading with skeleton rows, and the form fields carry a loading of their own.

Draft — 128 products.

Nesting a BbSpinner inside a button paints the picture without the behaviour: the button stays clickable and assistive tech is told nothing.

Coming from v2

BbButton tracking async click handlers is new in v3. The spinner you placed inside a button, and the ref that drove it, can both go.

Size and color

Sizes run from xs to 2xl, 12 to 40px, and md is the default. Beside helper text, use sm.

xssmmdlgxl2xl3rem

A spinner takes the text color of whatever it sits in. To recolor it, color the wrapper.

Checking availability Syncing catalogue Retrying after an error

Under prefers-reduced-motion: reduce the dots hold at full size instead of pulsing.

Coming from v2

The color prop is gone. Color the surrounding text instead.

Inline waits

A region with nothing to show yet gets a large spinner, centered, above a line naming what is coming.

When the wait belongs to a single field or row, keep the spinner there and keep it small.

Where the shape of the incoming content is known and stable, placeholder rows say more than a spinner. BbTable ships them behind loading and skeleton.

Announcing the wait

Announce the wait exactly once; setting up both routes reads it out twice.

With visible text Loading recent activity…
Standing alone
ActivityLoading recent activity

When visible text sits beside the spinner, put role="status" on the container holding both and leave label unset. When the spinner stands alone, label wraps it in its own role="status" with the text rendered sr-only.

When the wait becomes measurable

Some waits change nature halfway through. A CSV import validates the file first, with nothing to count, then writes rows it can count.

Import team members team-export.csv · 25 rows

Spin while the number does not exist, and fill a bar from the moment it does. BbProgress has no indeterminate mode to fall back on: a null value renders an empty bar, not an animation.