# Build a form people can complete

Make each field, validation result, and next action clear in context.

## What makes a form understandable?

Give every field a visible label, explain constraints before people need them, and keep related controls together. A placeholder is an example or hint, not a replacement for a label. Use the control that matches the value: [Input](/components/input) for short text, [Textarea](/components/textarea) for longer text, [Select](/components/select) for one selected option, [Checkbox](/components/checkbox) for independent choices, and [Switch](/components/switch) for an immediate setting.

[Field](/components/field) associates a control with its label, description and error. [Form](/components/form) coordinates submission and validation; [Fieldset](/components/fieldset) groups related fields under a shared legend. Choose a grouping only when it helps someone understand the form. Put field errors next to the affected field and give form-level failures a clear summary when several values may be involved.

## When should I validate?

Validate early when it gives useful guidance without blocking entry. Validate on submit when a rule requires the whole value or remote check. In either case, keep the message specific: identify what needs attention and how to correct it. Do not report success just because the browser accepted a value or the submit handler ran.

For async validation, distinguish checking from failure. Avoid racing responses: an older result must not replace feedback for the current value. Keep the current value and submission status in application state when the product needs retries, navigation persistence, or server recovery. A form primitive does not decide your server schema, authorization, persistence, or business rules.

## Who owns submit state and recovery?

The caller handles submission and decides how to treat pending, success, and failure. Disable or otherwise guard duplicate submissions when the operation requires it, but retain enough context for correction. If saving fails, explain whether the entered values remain and what action can retry. Keep the submit Button's name tied to the action.

Ghost's source registry installs React components and their dependencies into the app. Follow [Installation](/docs/installation) and the specific component recipe. See [Styling](/docs/styling) for host tokens and component CSS.

**Next step**

Keep the value when a recoverable save fails.

## How do I check keyboard and assistive use?

Use the rendered application to check that labels activate or identify their controls, required state is communicated, errors are associated with the right field, and keyboard users can reach and operate each control. Preserve visible focus and logical reading order. These checks are concrete responsibilities, not a blanket claim of conformance: a component's underlying primitives do not certify the accessibility of the complete form or its content.

For behavior patterns, [WAI's form notifications guidance](https://www.w3.org/WAI/tutorials/forms/notifications/) explains error and success feedback. [React Aria](https://react-spectrum.adobe.com/react-aria/components.html) documents a separate component system; [Radix UI](https://www.radix-ui.com/primitives) documents its own primitives. Ghost uses the behavior stated on its pages and does not require either library as an application-level dependency by virtue of this comparison.

## What if errors or fields are hard to find?

Check label association, message placement, focus visibility, and the order in which errors are encountered. Avoid relying on red alone to communicate a problem. Keep the user's original input after a recoverable error. If validation depends on a remote service, show a pending state and a meaningful failure path rather than a false valid/invalid answer. The [Form](/components/form) and [Fieldset](/components/fieldset) pages show supported composition; copy their existing recipes rather than inventing new component props.
