BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/billui/billing-address

Billing Address

billui/billing-address
FreeComponent

Composable address form with correct autocomplete attributes. Country and state selects are automatically linked.

Install it

npx shadcn@latest add https://billui.com/r/billing-address.json

Source

src/registry/ui/billing-address.tsxbillui.com/r/billing-address.json · first 6 KB
1"use client";
2
3import * as React from "react";
4import { Input } from "@/components/ui/input";
5import {
6 Select,
7 SelectContent,
8 SelectItem,
9 SelectTrigger,
10 SelectValue,
11} from "@/components/ui/select";
12import {
13 COUNTRIES,
14 getStatesForCountry,
15 type IState,
16} from "@/lib/billing-address-data";
17import { useControllableState } from "@/lib/use-controllable-state";
18import { cn } from "@/lib/utils";
19
20interface BillingAddressContextValue {
21 countryCode: string;
22 setCountryCode: (code: string) => void;
23 states: IState[];
24}
25
26const BillingAddressContext =
27 React.createContext<BillingAddressContextValue | null>(null);
28
29function useBillingAddressContext() {
30 const context = React.useContext(BillingAddressContext);
31 if (!context) {
32 throw new Error(
33 "BillingAddress components must be used within a BillingAddress provider",
34 );
35 }
36 return context;
37}
38
39interface BillingAddressProps
40 extends Omit<React.HTMLAttributes<HTMLDivElement>, "defaultValue"> {
41 /** Controlled country code (ISO 3166-1 alpha-2) */
42 country?: string;
43 /** Default country code for uncontrolled mode */
44 defaultCountry?: string;
45 /** Callback when country changes */
46 onCountryChange?: (code: string) => void;
47}
48
49const BillingAddress = React.forwardRef<HTMLDivElement, BillingAddressProps>(
50 (
51 {
52 className,
53 country,
54 defaultCountry = "US",
55 onCountryChange,
56 children,
57 ...props
58 },
59 ref,
60 ) => {
61 const [countryCode, setCountryCode] = useControllableState(
62 country,
63 defaultCountry,
64 onCountryChange,
65 );
66
67 const states = React.useMemo(
68 () => getStatesForCountry(countryCode),
69 [countryCode],
70 );
71
72 const contextValue = React.useMemo(
73 () => ({ countryCode, setCountryCode, states }),
74 [countryCode, setCountryCode, states],
75 );
76
77 return (
78 <BillingAddressContext.Provider value={contextValue}>
79 <div
80 ref={ref}
81 className={cn("flex flex-col gap-4", className)}
82 {...props}
83 >
84 {children}
85 </div>
86 </BillingAddressContext.Provider>
87 );
88 },
89);
90BillingAddress.displayName = "BillingAddress";
91
92/**
93 * Configuration for billing address fields.
94 * Ensures proper browser autofill, accessibility, and UX.
95 */
96const billingFieldConfig = {
97 name: {
98 autocomplete: "billing name",
99 inputMode: "text" as const,
100 spellCheck: true,
101 },
102 line1: {
103 autocomplete: "billing address-line1",
104// … truncated

What it pulls in

Other registry items

  • input
  • select
  • https://billui.com/r/billing-address-data.json
  • https://billui.com/r/use-controllable-state.json
  • https://billui.com/r/utils.json

Files it writes

  • src/registry/ui/billing-address.tsx

Facts

Registry
billui
Type
registry:ui
Access
Free
Files written
1
Licence
MIT
In the index
at or before 2026-08-13
Last confirmed
yesterday

Go to the source

billui.com commet-labs/billui on GitHub Raw registry item This item as JSON

More from billui

All 13 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
Animated Usage Cardanimated-usage-cardbilluiComponentsFree2 deps
Card Iconscard-iconsbilluiComponentsFree1 dep
Card Inputcard-inputbilluiComponentsFreeno deps
Invoice Cardinvoice-cardbilluiComponentsFree2 deps
Payment Methodpayment-methodbilluiComponentsFree2 deps
Plan Cardplan-cardbilluiComponentsFree2 deps
Plan Groupplan-groupbilluiComponentsFree1 dep
Pricing Tablepricing-tablebilluiComponentsFree2 deps

Also from Kynth Studios

Built for the same person as BlockDex

SkillWorks

Claude Code skills and plugins, scored

skillworks.kynth.studio

RuleStack

AGENTS.md gallery and agent-config comparison

rulestack.kynth.studio

KitGrade

SaaS starter kits, scored from measured facts

kitgrade.kynth.studio

The studio list

One product, taken apart, once a month

Kynth Studios pulls one shipped product open every month — what it does, what it cost to build, what the pipeline behind it looks like, and what the numbers did. One email a month, nothing in between.

Double opt-in — we send one confirmation link and nothing else until you click it.

BlockDex

Built by

Kynth Studios

the studio behind SkillWorks, RuleStack and KitGrade

part of Toolproof, the measurement layer for AI agent tooling

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

© 2026 BlockDex. A Kynth Studios product. Changelog

BlockDex

The studio list

One product, taken apart, once a month

Kynth Studios pulls one shipped product open every month — what it does, what it cost to build, what the pipeline behind it looks like, and what the numbers did. One email a month, nothing in between.

Double opt-in — we send one confirmation link and nothing else until you click it.

BlockDex

Built by

Kynth Studios

the studio behind SkillWorks, RuleStack and KitGrade

part of Toolproof, the measurement layer for AI agent tooling

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

© 2026 BlockDex. A Kynth Studios product. Changelog

BlockDex

The studio list

One product, taken apart, once a month

Kynth Studios pulls one shipped product open every month — what it does, what it cost to build, what the pipeline behind it looks like, and what the numbers did. One email a month, nothing in between.

Double opt-in — we send one confirmation link and nothing else until you click it.

BlockDex

Built by

Kynth Studios

the studio behind SkillWorks, RuleStack and KitGrade

part of Toolproof, the measurement layer for AI agent tooling

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

© 2026 BlockDex. A Kynth Studios product. Changelog

BlockDex