AddressForm
Structured checkout form for collecting shipping or billing address details with optional company, phone, and email fields.
Best for
Import
import { AddressForm } from "@enadhq/enad-react-sdk/client/storefront"When to use it
Use AddressForm when checkout needs a complete shipping or billing address surface with consistent labels, validation hooks, and optional business-related fields.
Composition notes
The form is fully controlled through value and onChange. countries switches the country field from free text to a select, while showCompany, showRegion, showPhone, and showEmail let you tune the field set for different markets and checkout flows.
Keep the value shape aligned with your checkout model so server validation can map straight back to field keys such as postalCode and address1. When the market changes the required fields, prefer toggling the optional props instead of forking the whole form markup.
Behavior and theming guidance
Keep validation and persistence outside the component so the form stays tied to the real checkout state. Use errors and labels to localize the experience and make field-level problems obvious.
The form already wires aria-invalid and field-level error descriptions for the text inputs, so the main job is feeding it accurate error messages at the right time. Use className to place the form inside your checkout grid, but keep spacing and field hierarchy consistent so billing and shipping forms still feel related.
Examples
Live examples you can edit directly in the sandbox.
Shipping address form
Keep the form controlled from parent state so checkout logic, validation, and persistence stay in one place.
Localized form with field errors
Feed translated labels and server-side validation back into the same controlled form state.
Component Sets
Preview the first example across the available component-set presets to compare tone, spacing, and structural defaults.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| value | Partial<AddressData> | — | No description yet. |
| onChange | (field: keyof AddressData, value: string) => void | — | No description yet. |
| onSubmit | string | — | No description yet. |
| errors | string | {} | No description yet. |
| countries | string | [] | No description yet. |
| showCompany | boolean | false | No description yet. |
| showRegion | boolean | true | No description yet. |
| showPhone | boolean | false | No description yet. |
| showEmail | boolean | false | No description yet. |
| className | string | — | No description yet. |
| labels | string | {} | No description yet. |