Spinner
Overview
A loading spinner with multiple sizes and variants for async states.
This feedback component is intended for interfaces that need a loading spinner with multiple sizes and variants for async states, form workflows, and support tools. Its implementation is provided as editable source so the final behavior and styling stay inside your project.
Technologies
No additional package dependency is declared for this component.
Installation
Usage
Size
With text and custom style
Toggle spinner
Properties
| Prop | Type | Default | Description |
|---|---|---|---|
className | string | - | Customize the style by adding tailwind. |
size | 'small' | 'medium' | 'large' | medium | Spinner size. |
show | boolean | true | Visibility of spinner. |
children | React.ReactNode | - | Add custom component or text. |
Use cases
- interfaces that need a loading spinner with multiple sizes and variants for async states
- form workflows
- support tools
Features
- Copy-paste source that remains in your repository
- TypeScript source included with the component
- Tailwind CSS classes editable in the component source
- shadcn/ui dependencies: local UI primitives
- Spectrum UI registry dependencies: @spectrumui/spinner-dependencies
Accessibility
- Test focus order, keyboard operation, labels, contrast, and screen-reader output in the final application context.
Customization
- Edit the Tailwind utility classes in the copied source to match your spacing, color, and typography tokens.
- Use the documented className surface for local layout adjustments, then edit the source for structural changes.
Related components
Topic guides
See how this component fits into broader interface patterns, implementation decisions, and working examples.
Spinner FAQ
Is Spinner free to use in commercial projects?
Yes. The public Spinner source is available under the Apache License 2.0, including for commercial use, subject to the LICENSE terms.
How do I install Spinner?
Run npx shadcn@latest add @spectrumui/spinner-demo or npx shadcn@latest add @spectrumui/spinner-size or npx shadcn@latest add @spectrumui/spinner-with-text or npx shadcn@latest add @spectrumui/spinner-toggle. The page also exposes the source for manual installation.
Does Spinner require Motion?
No Motion dependency was detected in the documented source or registry entry for Spinner.
Does Spinner use shadcn/ui or Radix UI?
Spinner uses local shadcn/ui primitives.
Can I use Spinner in Next.js?
The documented React source is used in this Next.js application. Keep its use client directive when copying it into the App Router. Install the detected dependencies and verify any application-specific data or image configuration.
What accessibility checks should I run for Spinner?
No component-specific accessibility mechanism was detected automatically. Test keyboard operation, focus, labels, contrast, and screen-reader output before shipping.