Loaderv2.0.2Documentation Under Review
A flexible loader component for displaying loading states, error messages, and empty states in product applications with customizable text and icons.
Prefer AI-assisted development?
Catalyst Loader provides a unified solution for handling loading, error, and empty-result states — automatically rendering the correct state based on isLoading, error, and resultsLength props, with built-in design tokens and CVA variants.
Installation
npm install @pmi/catalyst-loaderimport { Loader, LoaderText } from '@pmi/catalyst-loader';Common Patterns
Error
Display an error message with an icon when something goes wrong.
Not Found
Display a message when no results are found.
Custom Messages
Customize the text for each state to provide better context to users.
API Reference
Loader is a compound component. The sections below document each part.
Loader
The outer wrapper that conditionally renders based on isLoading, error, and resultsLength. Only one state is shown at a time: loading takes highest priority, then error, then not-found.
Prop
Type
LoaderText
Renders the status text inside a <span>. Automatically selects a default message when children is not provided.
Prop
Type
Accessibility
Loader is designed to meet WCAG 2.2 AA standards.
ARIA
Loaderrenders a plain<div>. For dynamic content that updates after the initial render, wrap with anaria-live="polite"region so assistive technologies announce state changes.- Icon children (e.g.
AttentionIcon,Spinner) should carry their own accessible labels or be hidden witharia-hiddenwhen the accompanyingLoaderTextprovides sufficient context. - The component is display-only and non-interactive — no keyboard handling is required.
- Catalyst provides visual styling tokens; consuming teams are responsible for correct
aria-livesemantics and any surrounding landmark structure.
Choosing the Right Component
Use Loader when you need a lightweight inline indicator for data-fetching states. Reach for a different primitive when:
| If you need… | Use instead |
|---|---|
| A standalone spinning indicator without text | Spinner |
| Placeholder shapes while content loads | Skeleton |
| A prominent dismissible status or error message | Alert |
Related
CoachMark
An interactive guided tour component for product onboarding with full custom styling support. Built on react-joyride with customizable tooltips, 13 placement options, and CVA theming capabilities.
Progress
A progress indicator built on Radix UI Progress with CVA variants, horizontal and vertical orientations, segmented multi-step patterns, and smooth animations.