Skip to main content
PimentCSS v1.0.1, what's new
Home

Loader

Spinners and in-context loading states.

Indeterminate loader for operations without a known duration. Eight dots orbit with a cascade pulse. Styles live in scss/components/_loader.scss. When you can show percent complete, use Progress instead.

Sizes and types

Four footprints (24 to 48px) and two color treatments. Each loader needs role="status" and an accessible name via aria-label.

48px
40px
32px
24px
Primary
Secondary

Eight orbiting dots with staggered pulse animation. Use loader--primary on brand surfaces; loader--secondary on muted backgrounds.

In context

Pair the loader with aria-busy="true" on the loading region. Hide the loader with the hidden attribute when idle so assistive tech is not announced repeatedly.

Dashboard summary

Placeholder content while data loads.

Behavior in your app

Copy docs-site/src/lib/loader-behavior.ts and call wireAllLoaders() after load, or toggle aria-busy and hidden from your data layer.

Class reference

ClassDescription
.loaderInline host for eight .loader__dot elements
.loader--48.loader--24Footprint and dot size tokens
.loader--primaryBrand action color (--surface-action)
.loader--secondaryNeutral orbit (--neutral-400)
.loader__dotPulsing dot (decorative, aria-hidden)
data-loader-liveDoc region wired by wireAllLoaders()
data-loader-toggleButton toggles busy state on data-loader-target

Customize (Sass)

  1. Loader layout

    Override footprint, dot size, and orbit distance before importing components.
    @use "pimentcss-design-system" with (
      $loader-size-48: 3.5rem,
      $loader-dot-32: 5px,
      $loader-orbit-ratio: 0.4
    );
  2. Rebuild CSS

    Run after editing _loader.scss.
    npm run build:css

Accessibility (RGAA / WCAG)

Loaders

  • Status, use role="status" with a concise aria-label (for example “Loading”). Add aria-live="polite" when the loader can appear dynamically.
  • Busy region, set aria-busy="true" on the container while content loads; remove it and hide the loader when done.
  • Dots, mark each .loader__dot with aria-hidden="true"; do not expose eight separate elements to screen readers.
  • Known duration, prefer Progress with role="progressbar" when a percentage is available.

Next steps