Skip to content

GkSpinner

CSS spinner with role="status", aria-live="polite", and configurable aria-label.

When to use

Use for short-lived loading states inside buttons, cards, and inline async flows.

Live Examples

Sizes

sm and md inline spinners with explicit labels.

On filled surfaces

tone on-filled keeps contrast on primary-colored regions.

On solid fills, use tone="on-filled" (GkButton does this when loading):

Button loading

GkButton shows a spinner and accepts loading-label for assistive text.

API

Props

PropTypeDefaultDescription
size'sm' | 'md''md'Visual size
labelstring'Loading'Exposed to assistive tech
tone'default' | 'on-filled''default'on-filled uses --gk-color-text-on-primary for the ring so it stays visible on solid primary/danger fills; GkButton passes this automatically when loading on those variants

Examples

Each scenario under Live Examples includes a copyable Vue snippet (source is imported from the same SFC as the preview).

Accessibility notes

  • Always provide a contextual label when the spinner appears away from surrounding explanatory text.
  • Avoid long-running spinner-only states; pair with status text when operations can take longer.

Released under the MIT License.