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

Pending Value

API and Development

View SourceOpens in a new tabSubmit IssueOpens in a new tab
Import PendingValue, PendingValueAppearance, PendingValueLines, PendingValueWidth from @prepared911/ui/pending-value.
pending
Required boolean. True while the value is on its way: the label shows and the value is hidden from sight, assistive technology and the tab order. False once it has arrived. The host sets data-loading while pending.
label
Required LocalizedMessage. The pending copy, such as "Locating address". It is real text in the document, so assistive technology that reaches the value reads it. It is the visible text unless placeholder is set, and the hidden name of the line in the skeleton appearance.
children
ReactNode. The arrived value. It takes the color and type of the surrounding text and host. Children passed while pending are not shown but still reserve size.
placeholder
ReactNode. A short visible stand-in for label, such as an ellipsis. It is aria-hidden; label is read instead as visually hidden text. Ignored in the skeleton appearance.
announcement
LocalizedMessage. Read once through the shared polite live announcer when pending turns from true to false. Not read on the first render, and not read when a value goes back to pending. Omitted, the arrival is silent.
appearance
PendingValueAppearance: Text (default) or Skeleton. Skeleton renders a Skeleton line named by label.
type
A TextType from PENDING_VALUE_TYPES: Subtitle, SubtitleMedium, BodyLarge, BodyLargeEmphasis, BodyMedium (default), BodyMediumEmphasis, Label, Caption, CaptionEmphasis, Code1, Code2. Page, section, title and overline roles are rejected at compile time.
foreground
Foreground.Subtle (default) or Foreground.Default, from PENDING_VALUE_FOREGROUNDS. It colors the pending label only. Muted, status and accent colors are rejected at compile time.
width
PendingValueWidth: Label, Short, Medium, Long. Inline size kept in both states. Label (the default in the text appearance) is the width of the pending label; Short is 4rem, Medium 8rem, Long 12rem. In the skeleton appearance the default is Medium.
lines
PendingValueLines: One (default), Two, Three. Block size kept in both states, in lines of type.
className, id, ref, data-*
className is appended after the generated classes. ref is typed Ref<HTMLElement>. style, role, every aria-* attribute and every on* handler are not accepted: only id and data-* reach the host.
Exports
PendingValue, PendingValueProps, PendingValueLayoutProps, and from the component entry PendingValueAppearance, PendingValueWidth, PendingValueLines, PENDING_VALUE_TYPES, PENDING_VALUE_FOREGROUNDS and their types.
Props
PropDefaultMeaning
pendingWhether the value is still on its way. While true the pending label shows; when it turns false children swaps in.
labelWhat assistive technology reads while the value is pending, such as "Locating address". It is real text in the document, so a screen reader that reaches the value hears it instead of a blank. It is also the visible text unless placeholder is set, and the name of the skeleton in the skeleton appearance.
childrenThe value once it has arrived. It stays out of the accessibility tree and the tab order until pending is false. It takes the surrounding color. Pass Text with value for a number: later changes then roll.
placeholderShort visible stand-in for label, such as an ellipsis. It is hidden from assistive technology and label is read instead. Ignored in the skeleton appearance, which shows no text.
announcementPolite announcement read once when the value arrives (pending turns from true to false), such as "Address found". Without it the arrival is silent: the value is plain text and is read when the person reaches it. Not read on the first render.
appearanceHow the pending state looks. Defaults to the label as text.
typeChroma typography role of the label and of the host. Defaults to body medium (13px).
foregroundForeground of the pending label. Defaults to subtle. The arrived value takes the surrounding color.
widthInline size kept in both states. Defaults to the label's width, or to Medium in the skeleton appearance.
linesBlock size kept in both states, in lines of type. Defaults to one.
classNameClasses appended after the generated classes. Put overrides in @layer chroma.overrides.
idElement id.
refRef to the rendered element.
Props
NameTypeDefaultDescription
labelLocalizedMessage—What assistive technology reads while the value is pending, such as "Locating address". It is real text in the document, so a screen reader that reaches the value hears it instead of a blank. It is also the visible text unless placeholder is set, and the name of the skeleton in the skeleton appearance.
pendingboolean—Whether the value is still on its way. While true the pending label shows; when it turns false children swaps in.
announcementLocalizedMessage—Polite announcement read once when the value arrives (pending turns from true to false), such as "Address found". Without it the arrival is silent: the value is plain text and is read when the person reaches it. Not read on the first render.
appearancePendingValueAppearance—How the pending state looks. Defaults to the label as text.
childrenReactNode—The value once it has arrived. It stays out of the accessibility tree and the tab order until pending is false. It takes the surrounding color. Pass Text with value for a number: later changes then roll.
classNamestring—Classes appended after the generated classes. Put overrides in @layer chroma.overrides.
foregroundForeground.Default | Foreground.Subtle—Foreground of the pending label. Defaults to subtle. The arrived value takes the surrounding color.
idstring—Element id.
linesPendingValueLines—Block size kept in both states, in lines of type. Defaults to one.
placeholderReactNode—Short visible stand-in for label, such as an ellipsis. It is hidden from assistive technology and label is read instead. Ignored in the skeleton appearance, which shows no text.
refRef<HTMLElement>—Ref to the rendered element.
typeTextType.Subtitle | TextType.SubtitleMedium | TextType.BodyLarge | TextType.BodyLargeEmphasis | TextType.BodyMedium | TextType.BodyMediumEmphasis | TextType.Label | TextType.Caption | TextType.CaptionEmphasis | TextType.Code1 | TextType.Code2—Chroma typography role of the label and of the host. Defaults to body medium (13px).
widthPendingValueWidth—Inline size kept in both states. Defaults to the label's width, or to Medium in the skeleton appearance.
Storybook
Interactive examples and edge cases for this component are in Storybook.
DefaultOpens in a new tab
Previous
Pending Value / Usage
Next
Pending Value / Accessibility
On this page
pending
label
children
placeholder
announcement
appearance
type
foreground
width
lines
className, id, ref, data-*
Exports
Props
Props
Storybook