Installation
npx logic2b@next add spinnerUsage
import { Spinner } from "@/components/ui/spinner"
<Spinner />
<Spinner className="size-6 text-primary" />
Usage notes
Renders lucide-react’s Loader2Icon with animate-spin; any prop accepted by an
<svg> element (e.g. className for size/color) is passed through. It ships with
role="status" and aria-label="Loading" so assistive technology announces it.
Examples
Sizes
In a button
Live playground
Edit the component props and inspect the exact JSX before copying it. The preview loads only when this section enters the viewport.
Generated JSX
<Spinner
className="size-6"
aria-label="Loading content"
/>API reference
Generated from the public TypeScript exports in src/ui/spinner.tsx.
Spinner
ComponentProps: React.ComponentProps<"svg">Accessibility contract
Machine-readable behavior and consumer responsibilities for spinner.
- Support
- Authored behavior
- Pattern
- status
- SVG role=status
Built-in semantics
- Exposes role=status with a default Loading accessible name.
Consumer responsibilities
- Replace the label when the loading operation needs more context.