Staaarter

Billing Address Form

A billing address form for account settings or checkout flows, with borderless inputs for a cleaner look than boxed form fields. It collects a country, street address, city, state, postal code, and an optional tax ID or VAT number, validates the required fields on submit, and shows a saving state followed by a confirmation.

By Staaarter Team
Billing
Updated April 2, 2026
Docs
Live preview

Docs

Installation

A real shadcn registry command, not a copy-paste stand-in: it fetches this block plus its input, label, button dependencies and any missing npm packages, and installs them straight into your project.

npx shadcn add https://staaarter.com/r/billing-address-form.json

Prefer not to use the CLI? Copy the source from the Code toggle above into src/components/blocks/billing/billing17.tsx instead.

Usage

The file also exports billing17Demo, the exact props behind the preview above. Spread it to get a working section in one line, then replace it with your own data.

import { Billing17, billing17Demo } from "@/components/blocks/billing/billing17";

export default function Page() {
  return <Billing17 {...billing17Demo} />;
}

Props

PropTypeDefaultDescription
headingstring"Billing address"Heading above the form.
descriptionstring"Used for invoices and tax calculation."Supporting sentence under the heading.
countriesCountryOption[]noneOptions rendered in the country select, in the order given.
defaultValuesPartial<BillingAddressValues>noneInitial field values. Any field left out starts blank, except country which falls back to the first entry in countries.
saveLabelstring"Save changes"Label on the submit button.
classNamestringnoneExtra classes for the outer card.

Types

interface CountryOption {
  code: string;
  name: string;
}

interface BillingAddressValues {
  country: string;
  line1: string;
  line2: string;
  city: string;
  state: string;
  postalCode: string;
  taxId: string;
}

Behavior notes

  • Country is a native HTML select, not a custom dropdown component, so it works without JavaScript and inherits the borderless input styling.
  • On submit, line1, city, postalCode, and country are required; state, address line 2, and tax ID are optional and never block submission.
  • A successful submit sets a saving state for 700ms before showing a Saved confirmation, standing in for a real network request. Swap the setTimeout in handleSubmit for your actual save call.
  • Editing any field after a failed or successful submit clears that field's error and resets the status back to idle.
  • Errors are shown per field under the input rather than in a single summary block, and invalid fields get aria-invalid so assistive tech announces them.

Frequently asked questions