Component reference
Spinner
A pending form action with visible saving feedback.
Preview
Live previewOptional six-digit hex. Clear to restore the preset. Check contrast with your brand color.
Changes apply to this preview only.
Activity and feedback
Try a local asynchronous action.
Width adapts to the available space
"use client";
import { useEffect, useState } from "react";
import {
Button,
Spinner,
Card,
CardHeader,
CardTitle,
CardContent
} from "@pimolu/react";
export function DemoExample() {
const [pending, setPending] = useState(false);
const [saved, setSaved] = useState(false);
useEffect(
() => {
if(!pending)
return;
const timer = setTimeout(() => { setPending(false); setSaved(true); }, 1200);
return () => clearTimeout(timer);
},
[pending]
);
return (
<Card>
<CardHeader>
<CardTitle>Activity and feedback</CardTitle>
</CardHeader>
<CardContent>
<div
className="grid gap-5 min-w-0"
>
<div
className="flex flex-wrap items-center gap-3 min-w-0"
>
<Spinner
label="Example activity indicator"
/>
<span>An indeterminate status with a readable label.</span>
</div>
<Button
disabled={pending}
aria-busy={pending || undefined}
onClick={() => { setSaved(false); setPending(true); }}
startIcon={pending
? <Spinner
size="sm"
decorative
/>
: undefined}
>
{
pending
? "Saving locally…"
: "Simulate saving"
}
</Button>
<p
role="status"
>{
saved
? "Demo saved. No network request was made."
: pending
? "Simulating a short pending action."
: "Try a local asynchronous action."
}</p>
</div>
</CardContent>
</Card>
);
}More examples
Different configurations and compositions using the real Pimolu API. Each preview runs independently and follows the site appearance.
Appearances
circular, dots and arc.
Sizes
xs to xl.
Variants
inherit takes the current text color; the others use a semantic token.
Usage
Pair indefinite activity with explanatory text and disable duplicate submissions deliberately.
API reference
Generated from the public TypeScript declarations. Native HTML attributes are inherited where the component extends them; this reference includes Pimolu props and selected common native attributes.
PimoluSpinnerProps
Type source| Name | Type | Default | Description |
|---|---|---|---|
appearance | "circular" | "dots" | "arc" | undefined | "circular" | Visual style of the loading indicator. |
size | "xs" | "sm" | "md" | "lg" | "xl" | undefined | "md" | Spinner size. |
variant | "primary" | "secondary" | "neutral" | "success" | "warning" | "danger" | "inherit" | undefined | "inherit" | Semantic color or inherited text color. |
label | string | undefined | "Loading..." | Accessible loading message. |
decorative | boolean | undefined | false | Hide the Spinner from assistive technology. |
onChange | ChangeEventHandler<HTMLSpanElement, Element> | undefined | — | Standard React/HTML attribute. |
defaultValue | string | number | readonly string[] | undefined | — | Standard React/HTML attribute. |
className | string | undefined | — | Standard React/HTML attribute. |
style | CSSProperties | undefined | — | Standard React/HTML attribute. |
onClick | MouseEventHandler<HTMLSpanElement> | undefined | — | Standard React/HTML attribute. |
appearance"circular" | "dots" | "arc" | undefinedDefault: "circular"
Visual style of the loading indicator.
size"xs" | "sm" | "md" | "lg" | "xl" | undefinedDefault: "md"
Spinner size.
variant"primary" | "secondary" | "neutral" | "success" | "warning" | "danger" | "inherit" | undefinedDefault: "inherit"
Semantic color or inherited text color.
labelstring | undefinedDefault: "Loading..."
Accessible loading message.
decorativeboolean | undefinedDefault: false
Hide the Spinner from assistive technology.
onChangeChangeEventHandler<HTMLSpanElement, Element> | undefinedNo default extracted.
Standard React/HTML attribute.
defaultValuestring | number | readonly string[] | undefinedNo default extracted.
Standard React/HTML attribute.
classNamestring | undefinedNo default extracted.
Standard React/HTML attribute.
styleCSSProperties | undefinedNo default extracted.
Standard React/HTML attribute.
onClickMouseEventHandler<HTMLSpanElement> | undefinedNo default extracted.
Standard React/HTML attribute.
Accessibility
- Provide a useful busy message and respect reduced motion without losing status information.