Back to components

Spinner

zyra-spinner

Loading indicators for async states, background fetches, and actions that need a clear pending signal.

Component preview

Explore the available states and the real library behavior for this component.

zyra-spinner Playground

4 sizes4 colors

Loading spinner with size, color and accessibility label support

Controls
size
color
label (aria)
Usage

<zyra-spinner />

size - xs / sm / md / lg

color - accent / accent-2 / white / current

label - screen reader text

Live Preview mdaccent
Loading...
Generated Code
<zyra-spinner size="md" color="accent"
  label="Loading..."
/>
Sizes xs to lg
Loading…xs
Loading…sm
Loading…md
Loading…lg
Colors 4 variants
Loading…accentprimary teal
Loading…accent-2secondary blue
Loading…whitefor dark backgrounds
Loading…currentinherits currentColor
Real World - Button Loading States click to simulate
Save changes
Upload file
Delete (shows error)
Real World - Inline Usage
Loading data table
Loading…Fetching records...
Async validator in input
Checking usernameLoading…
Full page overlay
Loading page...

Copy-paste example

Drop this into your Angular standalone component and it works out of the box.

spinner.demo.ts
import { Component } from '@angular/core';
import { ZyraSpinner } from 'zyra-ng-ui';

@Component({
  selector: 'app-demo-spinner',
  standalone: true,
  imports: [ZyraSpinner],
  template: `
    <zyra-spinner
      size="md"
      color="accent"
      label="Loading dashboard"
    />
  `,
})
export class DemoSpinnerComponent {}

Variants

All the visual modes and states available for this component.

accent

Teal accent color (default brand color)

muted

Low-contrast grey for subtle loading states

white

White variant for use on dark or colored backgrounds

API

All inputs and configuration options for zyra-spinner.

PropTypeDefaultDescription
size'sm' | 'md' | 'lg''md'Diameter of the spinner
color'accent' | 'muted' | 'white''accent'Spinner track color
labelstringLoading…Screen-reader-only label for accessibility

Accessibility

Built to meet WCAG 2.0 AA. These notes cover the key ARIA, keyboard, and interaction behaviours.

  • Renders with role="status" so screen readers announce the loading state
  • label is visually hidden but announced to screen readers
  • When embedding in a button, set button aria-busy="true" alongside the spinner