Spinner
updatedA loading indicator driven by clip-path, inheriting its colour from currentColor.
Demo
Installation
Usage
It carries no colour of its own and no size beyond the surrounding text's — it inherits currentColor and is 1em square until a class or a button sizes it, which is what lets it drop straight into a button.
In a button
API Reference
The only prop is class, merged over the base classes. Size and colour come from there, or from the surrounding text.
Spinner
No props, events, slots or exposed members.
Data attributes
| data-slot | Attributes | Description |
|---|---|---|
| spinner | data-icon="inline-start" | The svg. Marks itself as a leading icon so a Button tightens its start padding. |
Accessibility
The spinner is aria-hidden. On its own it announces nothing useful, so the state belongs on the control that is busy — a live region you own, or aria-busy you add yourself. Under prefers-reduced-motion: reduce it freezes at its widest frame rather than disappearing, so it still reads as loading.