Back to components

Checkout

Address Form

A validated shipping or billing address form built on react-hook-form and zod. Emits a normalized Address on submit.

form
validation
address

Preview

Installation

Run the shadcn CLI. Dependencies and the shared lib block come with it.

npx shadcn add address-form

Usage

Import
import { AddressForm } from "@/components/lumo/address-form"
Example
<AddressForm
  onSubmit={(address) => saveAddress(address)}
  submitLabel="Save address"
/>

Props

PropTypeDefaultRequired
defaultValuesPartial<Address>-
onSubmit(address: Address) => void-
submitLabelstring"Continue"
classNamestring-

All props accept standard HTML attributes unless otherwise specified.

Dependencies

Lumo blocks

  • lib

npm packages

react-hook-formzod@hookform/resolvers

Own every line

Lumo blocks copy into your repo. No runtime dependency, no lock-in. Edit the code to fit your product.