Form
Molecule
Stitch your own fields inside it; Form adds the stacked or two-column rhythm, titled sections, the submit and cancel actions row, and Enter to submit.
Playground
Every control sets a real prop of FormProps. The JSX below updates as you go.
Web
iOS
Android
JSX · FormProps
Variants
9 examples from src/molecules/form/form.md, each rendered live from its own JSX.
Anatomy
1
Section
2
Field
3
Actions
Dimmed parts appear only in some states or variants.
Props
12 props on FormProps, grouped as they are declared in source. Required props are marked *.
MeasureProps · width steps xxxs 192 · xxs 256 · xs 320 · sm 384 · md 448 · lg 512 · xl 576 · xxl 672 · xxxl 768 · wide 896 · wider 1024 · widest 1152 · page 1280, plus start to pin to the leading edge.
Accessibility and keyboard
Keyboard
Type
Edits the value
Tab
Next field
Escape
Clears when clearable
Semantics
Roles
group
ARIA on web
aria-label
Platform skins
The playground's props on each platform: same tree, native shapes, type and touch sizes.
Usage
On the web, Enter confirms an active Autocomplete suggestion before it can submit the form. A subsequent Enter submits after the list closes. Enter used to confirm an input-method candidate never submits, and holding Enter does not repeat submission. Multiline fields retain Enter for newlines. On native platforms, each field's onSubmitEditing owns the return-key action.
Form is a composition surface: you stitch the field atoms as children and keep their state; Form supplies the vertical rhythm, the actions row, and onSubmit, which fires from the submit button or from Enter in a single-line field on the web.
On the web a Form is a form landmark. Name it with accessibilityLabel, a brief statement of its purpose such as "Sign in", so a screen reader's landmark list can tell it apart; a page that holds more than one form needs a distinct name on each.
Tokens
Read from the playground render. Values follow the scheme and the ion hue.
--bg2
--bls
--bw
--fd
--ft
--ion
--ion-fg
--ln
--ln2
--tx
--tx2
--tx3