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

Confirmation

API and Development

View SourceOpens in a new tabSubmit IssueOpens in a new tab
Import Confirmation, ConfirmationButton from @prepared911/ui/confirmation. Confirmation and ConfirmationButton take the props below and nothing else: no native attributes, no ref, no style.
Confirmation
PropTypeDefaultNotes
childrenReactNoderequiredOne or more ConfirmationButton
acknowledgementLabelLocalizedMessagerequiredText for a choice without its own, and for a group that starts acknowledged
acknowledgementIconGlyphcheckGlyph before the acknowledgement
acknowledgedbooleanControlled state; false after true offers the choices again
onAcknowledge(label: LocalizedMessage | undefined) => voidOnce, on the first activated choice, before its onConfirm
labelLocalizedMessageNames the group of choices
classNamestringAppended to the root
ConfirmationButton
Must render inside a Confirmation; it throws otherwise.
PropTypeDefaultNotes
childrenReactNoderequiredVisible label
intentButtonIntentneutralButton intent
variantButtonVariantsoftButton surface
sizeButtonSizelargeButton height
iconGlyphDecorative glyph before the label
disabledbooleanfalseInert choice
onConfirm() => voidSide effect, once
acknowledgeLabelLocalizedMessagethe group's acknowledgementLabelText after this choice
classNamestringAppended to the button
Exports
Confirmation, ConfirmationButton, and the types ConfirmationProps and ConfirmationButtonProps.
Props
NameTypeDefaultDescription
acknowledgementLabelLocalizedMessage—Text of the acknowledgement for a choice that sets no acknowledgeLabel of its own, and for a group that starts acknowledged, such as "Done". It is also what assistive technology hears when the choices are replaced.
childrenReactNode—The choices: one or more {@link ConfirmationButton }.
acknowledgedboolean—Whether a choice has been made (controlled). Passing false after true offers the choices again.
acknowledgementIconGlyph—Glyph before the acknowledgement. Defaults to a check.
classNamestring—Classes appended to the root.
labelLocalizedMessage—Accessible name of the group of choices, such as "Next step". It is not applied to the acknowledgement.
onAcknowledge((label: LocalizedMessage) => void)—Runs once when the first choice is activated, before that choice's onConfirm, with the choice's acknowledgeLabel. It does not run for a group that starts acknowledged. @param label - The activated choice's acknowledgeLabel, when it has one
Storybook
Interactive examples and edge cases for this component are in Storybook.
DefaultOpens in a new tab
Previous
Confirmation / Usage
Next
Confirmation / Accessibility
On this page
Confirmation
ConfirmationButton
Exports
Props
Storybook