A phone number field: a country key, the national number grouped as you type, a validity node, and a searchable list of 22 countries; it reports E.164 once complete.
pnpm dlx shadcn@latest add @beautiful-ui-pro/phone-inputNeeds your registry key. Your components.json style picks the Base UI or Radix build: radix-*, new-york and default get Radix, base-* gets Base UI.
The CLI adds the styles to the CSS file named in components.json (tailwind.css). Check that it points at your global stylesheet, that the project uses Tailwind CSS v4, and that the file is imported in your root layout. Installed by hand: paste styles.css into that file.
Import it and pass your content. The props that matter most are listed next.
"use client";
import * as React from "react";
import { PhoneInput } from "@/components/ui/notchset/phone-input";
export function OnCallPhone() {
const [phone, setPhone] = React.useState("");
return (
<form action="/api/on-call" method="post">
<PhoneInput defaultCountry="PT" onValueChange={setPhone} />
<input type="hidden" name="phone" value={phone} />
</form>
);
}defaultCountry / defaultValue–
string / E.164Where to start.
onValueChange–
(e164, country) => voidE.164 once complete, "" until then.
countries–
{ iso, name, dial, groups }[]Your list (22 by default).
error–
stringA server's rejection, in place of the help line.
components/ui/notchset/phone-input.tsx
This component is included with Pro.
Try the live preview above. Get Pro to install the source.