redrob-labs

Address Input

Forms

About

A form control for entering a postal address in the field order the selected country actually writes it, with a single free-form textarea fallback for countries it doesn't know.

Built with React and Tailwind. Copy the prompt and paste it into Claude Code, Cursor or Lovable: your agent adds Address Input to your project and fits it to your theme.

Code

How Address Input is used: the demo's code. The component's own source comes with a free account.

Usage.tsx

"use client";

import * as React from "react";
import AddressInput, { type AddressValue } from "@/components/ui/address-input";

export default function AddressInputDemo() {
  const [value, setValue] = React.useState<AddressValue>({
    line1: "1600 Amphitheatre Parkway",
    line2: "",
    level2: "Mountain View",
    level1: "CA",
    postal: "94043",
  });

  return (
    <div className="bg-background text-foreground font-sans p-6 max-w-[420px] w-full">
      <AddressInput
        country="US"
        value={value}
        onChange={(next) => setValue(next)}
      />
    </div>
  );
}

More by redrob-labs

View all
  • Alert

    Alert

    18
  • Schedule Picker

    Schedule Picker

    15
  • Hero Section

    Hero Section

    7
  • Switch

    Switch

    5
  • Status Card

    Status Card

    4
  • Meter

    Meter

    2
  • Memory Scope

    Memory Scope

    2
  • Accordion

    Accordion

    2

More in Forms

View all
  • Premium Auth

    Premium Auth

    496
  • Authentication Card

    Authentication Card

    45
  • Login 1

    Login 1

    52
  • Login 2

    Login 2

    7
  • Form

    Form

    32
  • Card Studio

    Card Studio

    41
  • Login Card

    Login Card

    32
  • Form

    Form

    136