<c-spinner>
A circular indeterminate activity indicator — pure motion with no value, for waits of unknown duration.
Usage
Size the spinner with the size (diameter) and thickness (stroke) props, both in pixels; the 3.x width still sets the stroke until 5.0, and thickness wins when both are set. It spins forever; there is nothing to bind. If the wait has a known completion percentage, use c-progress-circle instead — the boundary is the axis (pure activity vs known value), not the shape.
When to use
- For short, inline unknown-duration waits — inside a button, next to a field, in a table cell.
- To cover a whole container while it loads, use
c-loader, which embeds this spinner behind a scrim with an optional message. - For known progress, use
c-progress-barorc-progress-circle.
Color
The stroke defaults to the primary role, so a standalone spinner is brand-coloured in either theme mode. The color prop accepts any CSS colour value; pass currentColor to make the spinner track the ambient text colour instead — the contract parent components (c-loader, c-switch) use to tint their embedded spinner.
Accessibility
The spinner is purely visual and exposes nothing to assistive technology. Announce the loading state on the region it describes — aria-busy on the updating container, or a live-region message. c-loader does not do this for you either: its slotted message gives visible context but is not announced.
Customization
::part(root) targets the <svg> drawing the circle. Prefer the size/thickness/color props for geometry and colour — the dash animation is computed from the size.
Examples
<template>
<div class="example-row">
<c-spinner />
<c-spinner size="48" thickness="4" />
<c-spinner color="var(--c-success)" size="48" thickness="4" />
</div>
</template>
API reference
<c-spinner>
A circular indeterminate activity indicator — pure motion with no value, for waits of unknown duration.
Properties
| Property | Attribute | Type | Default | Description |
|---|---|---|---|---|
color | color | string | 'var(--c-primary)' | Stroke colour, the primary role by default; `currentColor` follows the surrounding text colour. |
size | size | number | 24 | Diameter in pixels. |
thickness | thickness | number | — | Stroke thickness in pixels: 2 unless set. |
width deprecated | width | number | 2 | Deprecated. Use `thickness`. Stroke width in pixels. |
CSS parts
Style from outside with c-spinner::part(name) — parts are the library's only styling customization API.
| Part | Description |
|---|---|
root | The `<svg>` element that draws the spinning circle |