Components
Form
Form layout wrapper with spacing, validation messaging, and submission handling.
Import
Usage
With all Arcana form components
Most Arcana form components (Input, Textarea, Select, Checkbox) handle their own labels, hints, and errors via props. The Form wrapper adds consistent spacing between fields:
Form Props
| Prop | Type | Default | Description |
|---|---|---|---|
onSubmit | (e: FormEvent) => void | — | Form submit handler |
gap | 'sm' | 'md' | 'lg' | 'md' | Space between fields |
className | string | — | Additional CSS classes |
...rest | FormHTMLAttributes | — | All native form attributes |
FormField Props
| Prop | Type | Default | Description |
|---|---|---|---|
children | React.ReactNode | — | Label, input, and messages |
className | string | — | Additional CSS classes |
FormLabel Props
| Prop | Type | Default | Description |
|---|---|---|---|
htmlFor | string | — | Associates with input id |
required | boolean | false | Shows required asterisk |
children | React.ReactNode | — | Label text |
FormError / FormHint
Both render a <p> with appropriate styling. FormError adds role="alert".
Preventing double-submit
Accessibility
Formrenders a native<form>element- Associate every input with a label using
htmlFor/idor use Arcana'slabelprop FormErrorusesrole="alert"for screen reader announcements- Required fields should have both visual indicators and
requiredattribute