Axon 911 Frontend DocsAxon 911 Frontend Docs
Axon 911 Frontend Docs
    Loading navigation…
U
User
Switch to light mode
  1. Blocks
  2. Form Layout Sectioned
  3. API and Development

Form Layout Sectioned

API and Development

View SourceOpens in a new tabSubmit IssueOpens in a new tab
Import FormLayoutSectioned, FormLayoutSectionedLevel, FormLayoutSectionedSection, FormLayoutSectionedStatus from @prepared911/ui/blocks/form-layout-sectioned. See props.ts for the props and schema.ts for the declaration. FormLayoutSectioned takes every FormLayoutStandard prop except spacing and children; see that block's API for them.
FormLayoutSectioned
PropTypeDefault
childrenFormLayoutSectionedSection elementsnone
FormLayoutSectionedSection
PropTypeDefault
titleLocalizedMessagerequired
levelFormLayoutSectionedLevelTwo
descriptionLocalizedMessagenone
errorLocalizedMessagenone
statusFormLayoutSectionedStatusDefault
statusLabelLocalizedMessagenone
disabledbooleanfalse
childrenReactNode (the fields)none
idstringnone
classNamestringnone
refRef<HTMLDivElement>none
Props
NameTypeDefaultDescription
submitLabelLocalizedMessage—Label of the submit Button, for example "Save user". Name the action, not "Submit".
announceFieldErrorsboolean—Whether a control's error that appears or changes outside a submit attempt, such as after blur or async validation, is announced politely once through the live announcer. A submit attempt never announces each field: its focus move and errorSummary speak the errors. A cleared error announces nothing. Defaults to true; pass false when the page announces validation itself.
aria-descriptionLocalizedMessage—Extended description for assistive tech.
aria-labelLocalizedMessage—Accessible name when the visible label is insufficient.
aria-placeholderLocalizedMessage—Hint for an empty control.
cancelLabelLocalizedMessage—Label of the cancel Button. The Button renders only when this is set, so a form with no way out has no dead control. Pass onCancel with it.
childrenReactNode—One or more {@link FormLayoutSectionedSection } elements, in reading order.
classNamestring—Classes appended after the generated classes. Put overrides in @layer chroma.overrides.
descriptionLocalizedMessage—Copy under the top of the form that explains it. Describes the form to assistive technology.
errorFocusFormErrorFocus—Where focus goes after a submit attempt ends with the form invalid. Defaults to {@link FormErrorFocus.FirstInvalid}. Focus moves once per attempt, not on every render.
errorSummaryLocalizedMessage—Copy for the form-level error summary. When set, a live region (role="alert") renders before the children, is announced when it appears, and is linked to the form through aria-describedby. The copy comes from the caller; Form ships no default string.
extraActionsReactNode—Buttons rendered before Cancel in the actions row, for example a Reset.
footerFormLayoutStandardFooter.Inline—Where the actions are drawn. Defaults to {@link FormLayoutStandardFooter.Inline}.
invalidboolean—Whether the form is invalid, which decides if a submit attempt moves focus. Defaults to whether errorSummary is set. Pass it when per-field errors exist without a summary.
noValidateboolean—Sets the native noValidate attribute. Defaults to true, so browser constraint validation does not run ahead of the validation the caller runs in onSubmit. Pass false to let the browser block the submit and focus its first invalid control.
onAfterReset((event: Event) => void)—Called after the form resets and no reset handler canceled it, with the platform event. Use it to clear error state the form does not own. Form clears its own pending focus request.
onCancelMouseEventHandler<HTMLButtonElement>—Called when the cancel Button is pressed. The Button has type="button", so it never submits.
onSubmit((event: FormEvent<HTMLFormElement>) => void | Promise<void>)—Called when the form submits, after native constraint validation passes when noValidate is false, and unless a submit is already pending. It plays the role of ui-forms' onValid: validate here. Call event.preventDefault() to replace the native navigation with an explicit action. Return a promise to keep the form pending until it settles. A rejection stays with the caller; Form does not catch it.
pendingboolean—Whether a submit is pending. While pending, the form sets aria-busy, ignores further submits, and shares the state with {@link useFormPending }. Omit it to have Form track the promise the onSubmit handler returns. The page is never covered or disabled.
refRef<HTMLFormElement>—Ref to the rendered form.
requiredHintLocalizedMessage—One line that explains the required-field marker, for example "Fields marked with * are required". The marker itself is drawn by each required Field's Label. Say it once here, never on each field.
submitDisabledboolean—Disables the submit Button. Not for a pristine or invalid form: Save stays enabled and the form validates on submit (ADR 0023, decision 13). The layout tracks no field values and leaves any other reason to the caller.
submitIntentFormLayoutStandardIntent—Intent of the submit Button. Defaults to {@link FormLayoutStandardIntent.Accent}.
submitPendingLabelLocalizedMessage—Accessible name of the submit Button while a submit is pending. Defaults to {@link FormLayoutStandardActionProps.submitLabel}, so the name does not change.
titleLocalizedMessage—Native tooltip; accessibility hint, not visible UI title text.
widthFormLayoutStandardWidth—Maximum inline size. Defaults to {@link FormLayoutStandardWidth.Large}.
Storybook
Interactive examples and edge cases for this component are in Storybook.
DefaultOpens in a new tab
Previous
Form Layout Sectioned / Usage
Next
Form Layout Sectioned / Accessibility
On this page
FormLayoutSectioned
FormLayoutSectionedSection
Props
Storybook