Skip to main content
Pricing

Chart Placeholder

Free

A loading skeleton that occupies the same dimensions as the chart it replaces. Displays animated pulse bars, a circular donut outline, or a wavy line shape depending on the target chart type. Prevents layout shift while data is being fetched. Includes an accessible status announcement for screen readers.

4 variants

Loading chart data...

Variants

VariantDescriptionWhen to use
Default
With Message

Usage Guidelines

Do

Match the placeholder dimensions to the actual chart to prevent layout shift.

Don't

Show a spinner instead of a skeleton — skeletons communicate structure.

Do

Use the chart-specific variant when the type is known.

Don't

Leave an empty space while the chart loads — the layout jump is jarring.

Do

Announce the loading state to screen readers with aria-busy and a live region.

Don't

Animate aggressively — keep the pulse subtle and smooth.

Do

Use a subtle pulse animation at 1.5–2 second intervals.

Don't

Forget to handle the transition from skeleton to rendered chart.

Code

HTML
<div class="lex-chart-placeholder lex-chart-placeholder--bar"
  role="status" aria-label="Loading chart data">
  <div class="lex-chart-placeholder__bar"></div>
  <div class="lex-chart-placeholder__bar"></div>
  <div class="lex-chart-placeholder__bar"></div>
  ...
CSS Custom Properties
.lex-chart-placeholder {
  display: flex;
  align-items: flex-end;
  gap: var(--lex-space-8);
  padding: var(--lex-space-16);
  background: var(--lex-bg-surface);
  border-radius: var(--lex-radius-lg);
  min-height: 200px;
}

.lex-chart-placeholder__bar {
  flex: 1;
  background: var(--lex-bg-surface-subtle);
  border-radius: var(--lex-radius-xs);
  animation: lex-pulse 1.5s ease-in-out infinite;
}
...
React
// Using Lexicon CSS classes with React

<ChartPlaceholder
  variant="bar"
  height={300}
  aria-label="Loading chart data"
  ...

Design Tokens

TokenValue (dark)Value (light)CSS property
--lex-chart-placeholder-bgbg
--lex-chart-placeholder-borderborder
--lex-chart-placeholder-texttext

Accessibility

  • Use role="status" or aria-live="polite" to announce loading state.
  • Set aria-busy="true" on the chart container while loading.
  • Provide aria-label="Loading chart data" on the placeholder.
  • When data arrives, remove the placeholder and announce the chart via aria-live.

Keyboard Interactions

TabSkips the placeholder (non-interactive). Focus moves to the next element.