Spinner
An indicator for loading state.
Installation#
pnpm dlx shadcn@latest add @davinciui/spinnerUsage#
API Reference#
| Prop | Type | Default |
|---|---|---|
sizeSize of the spinner. | "sm" | "default" | "lg" | "default" |
classNameAdditional CSS classes (custom color). | string | — |
Accessibility#
The wrapper exposes role status with aria-label Loading and also renders hidden Loading text. The Lucide icon is decorative. The duplicated label may be announced twice, and callers can override aria-label but not the hidden text.
Motion#
Both the wrapper and Loader2 icon use the Tailwind animate-spin rotation, with no duration, easing, or reduced-motion handling. Size does not change animation timing.
View source
Click the icon in the preview toolbar to browse source for each variant.
Keep in mind
This component is inspired by various open-source projects and patterns. Please verify licenses and implementation details before using in production.
Need a custom component?
I build bespoke UI components & websites tailored to your brand.

