About
A phone number form field that lets you pick or search a country, auto-formats the number as you type, follows a pasted international number to the right country, and shows a plain-language validity message.
Built with React and Tailwind. Copy the prompt and paste it into Claude Code, Cursor or Lovable: your agent adds Phone Input to your project and fits it to your theme.
Code
How Phone Input is used: the demo's code. The component's own source comes with a free account.
Usage.tsx
import React from "react";
import PhoneInput from "@/components/ui/phone-input";
export default function PhoneInputDemo() {
const [value, setValue] = React.useState("");
return (
<div className="w-full max-w-sm">
<PhoneInput
label="Phone"
country="BD"
preferred={["BD", "MY", "SA", "TR"]}
hint="We'll text you when your manuscript is ready to collect."
value={value}
onValueChange={setValue}
/>
<p className="mt-3 text-sm text-muted-foreground tabular-nums">
{value ? `Saved as ${value}` : "Nothing saved yet"}
</p>
</div>
);
}
















