Skip to content
loseta

Components / Feedback

Spinner

Displays an animated loading indicator.

Status stable
Loading
<span class="spinner" role="status"><span class="sr-only">Loading</span></span>

Installation

pnpm dlx loseta add spinner
npx loseta add spinner

Examples

Sizes

Loading Loading Loading
<div style="display: flex; align-items: center; gap: 1rem">
  <span class="spinner" data-size="sm" role="status"><span class="sr-only">Loading</span></span>
  <span class="spinner" role="status"><span class="sr-only">Loading</span></span>
  <span class="spinner" data-size="lg" role="status"><span class="sr-only">Loading</span></span>
</div>

With a label

Loading results…
<div style="display: flex; align-items: center; gap: 0.5rem">
  <span class="spinner" data-size="sm" aria-hidden="true"></span>
  <span>Loading results…</span>
</div>

Accessibility and behavior

  • The spinner is a span; add role="status" and a .sr-only label for standalone use. data-size picks sm, default or lg. Motion slows under prefers-reduced-motion.

Files

components/spinner.cssbase
styles/nova/spinner.cssstyle

Install contract

The CLI writes the base file under components/, the visual file for the selected style under styles/<name>/, and any primitive dependency underprimitives/. The generated index.css imports them in the right layer order.

← Back to components

loseta is MIT licensed. Built with native CSS, no runtime. Inspired byshadcn/ui.