Skip to content

Form

Category: Forms & inputs

<Form
onSubmit={(e) => {
e.preventDefault(); /* ... */
}}
validationErrors={{ email: 'This email is already taken' }}
>
<TextInput name="email" label="Email" type="email" autoComplete="email" isRequired />
<Button type="submit">Sign up</Button>
</Form>

Install: @helix-ui/core

import { Form } from '@helix-ui/core';

status: stable · since: 0.1.0

Tags: form, validation, submit, rac

<Form>
Field…
Field…
[ Cancel ] [ Submit ]
</Form>
  • display — block
  • width — fill
  • height — content
  • intrinsicSize — native form element; layout by children
  • stackable — true
  • fullBleed — false

A <form> wrapper with no inherent visuals. Provides a validationErrors prop that surfaces server validation against fields by name.

Name Type Default Description
validationErrors Record<string, string | string[]> — Server-side validation errors keyed by field name. Forwarded to each FieldError.
onSubmit (e: FormEvent) => void — Submit handler. Native form behavior unless e.preventDefault().
...rest FormHTMLAttributes<HTMLFormElement> — All native form attributes.

space.5

Notes

  • Use <Form> instead of <form> to get react-aria’s coordinated validation handling.
  • Server errors via validationErrors are surfaced to the corresponding fields automatically.
Component Relation Note
Field child Each control is wrapped in a Field.
TextInput child RAC inputs accept label/description directly.
Button child Submit button at the end.
Textarea sibling
Checkbox sibling
RadioGroup sibling

These are the AI prompt → JSX mappings used by the helix-ui prompt DSL and integrations like Cursor / Claude Code.

“email + password + submit”

<Form onSubmit={handleSubmit}>
<TextInput name="email" label="Email" type="email" autoComplete="email" />
<TextInput name="password" label="Password" type="password" autoComplete="current-password" />
<Button type="submit">Sign in</Button>
</Form>