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

Shimmer

API and Development

View SourceOpens in a new tabSubmit IssueOpens in a new tab
Import Shimmer, ShimmerBase from @prepared911/ui/shimmer. Renders an inline span. Takes the props below and data-* attributes; nothing else reaches the DOM.
PropTypeDefaultNotes
childrenReactNoderequiredThe label, as copy
typeTextTypeBodyMediumTypography role of the label
activebooleantrueSweeps a highlight across the label
baseShimmerBaseDimResting tier: Dim or Readable
iconGlyphLeading glyph, decorative
classNamestringAppended after the generated classes
idstring
refRef<HTMLSpanElement>
Reserved design-system state names in data-* are dropped with a warning.
Exports
Shimmer, the enum ShimmerBase and the type ShimmerProps.
Props
NameTypeDefaultDescription
childrenReactNode—The label, such as "Thinking…". Copy from the caller.
activebooleantrueSweeps a highlight across the label while true. False renders the label as plain text at the subtle tier, in the same place, so toggling it moves nothing.
baseShimmerBaseShimmerBase.DimTier the label rests at between sweeps. Readable keeps the label at AA text contrast while it sweeps, for a label someone reads (a streaming "Thinking…"); the default Dim is a loading placeholder under that floor.
classNamestring—Classes appended after the generated classes.
iconGlyph—Leading glyph. It is decorative, stays when active is false, and sweeps in phase with the label.
idstring—Id of the root element.
refRef<HTMLSpanElement>—Ref to the root element.
typeTextTypeTextType.BodyMediumTypography role of the label.
Storybook
Interactive examples and edge cases for this component are in Storybook.
DefaultOpens in a new tab
Previous
Shimmer / Usage
Next
Shimmer / Accessibility
On this page
Exports
Props
Storybook