Form
Form + FormItem — primitives.
Live playground
Edit the JSX below — preview updates instantly. Switch brand × tone in the toolbar to see the same component re-themed in place.
Edit JSX — preview updates livereact-live
import { Form, FormItem } from "@avala/design"; <Form> <FormItem /> </Form>
All variants
The Storybook stories file rendered as an iframe — every variant, every size, every state, baselined for visual regression.
primitives-form--defaultOpen in Storybook →
When to use
- **
Form** — wrap any form surface that submits data. UseasForm={false}inside a Dialog where the host already owns the<form>element. - **
FormItem** — every label-control-helper row. Replaces inline<div className="flex flex-col gap-2">patterns.
When not to use
- Grouping ≥ 3 related inputs (e.g. address: street / city / zip) → use `FormGroup` (a
<fieldset>+<legend>wrapper). - Forms inside a controlled state machine (BLoC-like) where you don't want a native
<form>submit handler — renderForm asForm={false}. - Single-control surfaces (one TextInput at the top of a page) — just render the control directly.