Feedback
Spinner
An inline loading indicator for buttons, sections and overlays.
<script>
import { Spinner } from "@codeatlasdev/ui";
</script>
<Spinner size={24} />
The spinner has role="status" and a localized aria-label. Under prefers-reduced-motion it slows down instead of stopping. For buttons, prefer Button’s loading prop, which swaps the leading icon for a spinner and sets aria-busy.
Sizes
The size prop takes a number of pixels or any CSS length.
Code
In a button
Use the loading prop of Button instead of placing a Spinner by hand.
Code
Section loader
Loading data…
Code
Props
| Prop | Type | Default | Description |
|---|---|---|---|
size | number | string | 24 | Diameter. Numbers are pixels; strings are any CSS length. |
label | string | 'Loading…' (localized) | Accessible label. Defaults to the active locale's string. |
class | string | '' | Extra CSS classes. |