Forms
Phone Input
Country code prefix dropdown with phone number input, supporting 6 country codes with flag emojis.
Quick Preview
Installation
# No extra dependencies
// Copy component fromsrc/components/forms/PhoneInput.tsx
Usage
import PhoneInput from '@/components/forms/PhoneInput'<PhoneInputlabel="Phone Number"defaultCountry="TH"onChange={(value) => console.log(value)}/>
Prompt Preview
Copy a prompt that recreates this UI
Paste this into your AI coding assistant to generate code that closely matches the reference, including color, size, shape, typography, spacing, and polish.
Copy-ready AI prompt
Starts from the current visual reference and project constraints.
Tweak only product-specific copy or data after the first generation pass.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
label | string | - | Label above the input |
value | string | - | Controlled phone number value |
onChange | (value: string) => void | - | Called with full number including country code |
placeholder | string | "812 345 678" | Input placeholder |
className | string | - | Additional CSS classes |