Axon 911 Frontend DocsAxon 911 Frontend Docs
Axon 911 Frontend Docs
    Loading navigation…
U
User
Switch to light mode
  1. Components
  2. Loader
  3. API and Development

Loader

API and Development

View SourceOpens in a new tabSubmit IssueOpens in a new tab
Import Loader from @prepared911/ui/loader. Renders a span with role="status". Takes the props below and data-* attributes; nothing else reaches the DOM.
PropTypeDefaultNotes
labelLocalizedMessage | DisplayValueVisible text beside the spinner
aria-labelLocalizedMessageRequired when there is no label; optional with one
patternLoaderPatternDot-matrix animation in place of the spinner glyph
size12 | 16 | 20 | 2416Dot matrix only; 20 and up use a 4x4 grid, else 3x3
classNamestringAppended after the generated classes
idstring
refRef<HTMLSpanElement>
LoaderProps is a union: either label is set, or aria-label is required. Reserved design-system state names in data-* are dropped with a warning.
Exports
Loader, LOADER_PATTERNS and the types LoaderProps, LoaderPattern and LoaderDotSize. pattern is one of pulse, orbit, spiral, wave, scan, rain, sparkle or bloom.
Props
NameTypeDefaultDescription
aria-labelLocalizedMessage—Optional accessible name for the status region when the visible text is not enough. Accessible name of the pending state.
classNamestring—Classes appended after the generated classes.
idstring—Id of the root element.
labelLocalizedMessage | DisplayValue—Visible text beside the spinner, such as "Thinking…". No visible text.
pattern"pulse" | "orbit" | "spiral" | "wave" | "scan" | "rain" | "sparkle" | "bloom"—Plays a dot-matrix pattern in place of the spinner glyph. Omit for the spinner.
refRef<HTMLSpanElement>—Ref to the root element.
sizeLoaderDotSize—Size in px of the dot matrix; 24 and 20 use a 4x4 grid, 16 and 12 a 3x3 grid. Only applies with pattern.
Storybook
Interactive examples and edge cases for this component are in Storybook.
DefaultOpens in a new tab
Previous
Loader / Usage
Next
Loader / Accessibility
On this page
Exports
Props
Storybook