Skip to content
npm ↗ GitHub ↗

Documentation

36/Interaction and state

Skeleton and spinner

Loading placeholders and a spinner that takes the text or accent color.

Skeleton

HTML
<div class="cb-card cb-card--compact max-w-[360px]" role="status" aria-busy="true" aria-label="Cargando">
  <div class="flex items-center gap-3"><span class="cb-skeleton cb-skeleton--circle"></span><span class="cb-skeleton cb-skeleton--title"></span></div>
  <span class="cb-skeleton cb-skeleton--block"></span>
  <div class="cb-skeleton-stack"><span class="cb-skeleton cb-skeleton--text"></span><span class="cb-skeleton cb-skeleton--text"></span><span class="cb-skeleton cb-skeleton--text"></span></div>
</div>

Spinner

Cargando resultados
HTML
<span class="cb-spinner cb-spinner--sm" role="status" aria-label="Cargando"></span>
<span class="cb-spinner" role="status" aria-label="Cargando"></span>
<span class="cb-spinner cb-spinner--lg" role="status" aria-label="Cargando"></span>
<span class="cb-loading" role="status"><span class="cb-spinner" aria-hidden="true"></span>Cargando resultados</span>

Classes and modifiers

ClassDescription
.cb-skeletonBlock that pulses softly.
.cb-skeleton--text|title|circle|blockCommon shapes.
.cb-skeleton-stackStacked text lines; the last one is shorter.
.cb-spinnerCircular spinner. --sm and --lg for sizes.
.cb-loadingSpinner with text.

Accessibility

  • Mark the loading container with aria-busy="true".
  • A spinner only needs role="status" and aria-label.
  • Animations stop with prefers-reduced-motion.