Skip to content
VenusUI
Get started

Spinner

A circular loading indicator in three sizes that inherits the text color.

Preview

Installation

npx shadcn@latest add @venusui/spinner

Run this in a project set up with shadcn. If you haven’t set it up yet, run npx shadcn@latest init first.

Files added to your project

Paths use the default shadcn aliases. The CLI follows the aliases in your components.json.

  • @/components/ui/spinner.tsx

Usage

The code behind the preview above.

spinner-demo.tsx

import { Spinner } from "@/components/ui/spinner"

export default function SpinnerDemo() {
  return (
    <div className="flex items-center gap-6">
      <Spinner size="sm" />
      <Spinner />
      <Spinner size="lg" className="text-muted-foreground" />
      <button type="button" disabled className="inline-flex h-9 items-center gap-2 rounded-lg bg-primary px-4 text-sm font-medium text-primary-foreground opacity-80">
        <Spinner size="sm" label="Saving" />
        Saving
      </button>
    </div>
  )
}

API reference

PropTypeDefaultDescription
size"sm" | "md" | "lg""md"16, 24 or 32 pixels.
labelstring"Loading"Text announced to screen readers.

All <span> props except children.

Requirements

  • Tailwind CSS v4, with a cn helper at @/lib/utils. Works in Server Components.

Customization

  • Color it with a text class, e.g. className="text-muted-foreground".
  • Inside a button, use size="sm" and a specific label such as "Saving".

Accessibility

  • Has role="status", so the label is announced when the spinner appears.
  • With reduced motion it spins slowly instead of stopping, so it still reads as in progress.

Troubleshooting

Screen readers announce “Loading” twice.
Don’t also put visible “Loading” text inside the same status region; use the label prop instead.
Unknown registry "@venusui"
Your shadcn CLI couldn’t find the namespace in the shadcn registry index. Use the latest CLI (npx shadcn@latest), install by URL, or register it with its address: npx shadcn@latest registry add @venusui=https://venusui.com/r/{name}.json.
No components.json found
Run npx shadcn@latest init in your project first.
Loading preview

Bar Loader

Loaders

A thin indeterminate progress bar for pages and cards that are loading.

Loading preview

Three dots that rise and fall in turn, for typing or inline loading states.

Loading preview

Circular progress with the value in the middle, exposed as an accessible progress bar.