Number field
Enter a bounded number with clear increment controls.
A phone field with a country picker, formatting as you type, and E.164 output.
npx shadcn@latest add @silicon-ui/phone-inputnpx shadcn@latest add @silicon-ui/phone-inputInstall the dependencies.
npm install lucide-react motionCopy these files into your project. Shared files are skipped if you already have them.
components/silicon-ui/phone-input/phone-input.tsxcomponents/silicon-ui/phone-input/phone-input.module.cssInstall the foundation once per app for the design and motion tokens: npx shadcn@latest add @silicon-ui/silicon-foundation
| Prop | Type | Default |
|---|---|---|
label* | string | — |
hideLabel | boolean | false |
valueThe number in E.164, such as "+14155550132". An empty string clears the field. | string | — |
defaultValue | string | — |
onValueChangeFires on every edit with the E.164 number (empty when there are no digits) and its parsed details. | (value: string, details: PhoneInputDetails) => void | — |
countryISO code of the selected country. | string | — |
defaultCountryISO code used until someone picks a country or enters an international number. | string | "US" |
onCountryChange | (iso: string) => void | — |
countriesLimit the picker to these ISO codes. | string[] | — |
preferredCountriesPinned at the top of the picker under "Suggested". | string[] | ["US", "CA", "GB"] |
description | string | — |
errorReplaces the built-in validation message. | string | — |
validateShow a message after blur when the number is incomplete. On by default. | boolean | true |
disabled | boolean | false |
required | boolean | — |
nameAdds a hidden input carrying the E.164 value for native form submission. | string | — |
id | string | — |
className | string | — |
onBlur | (event: ReactFocusEvent<HTMLInputElement>) => void | — |
Also accepts the props of HTMLAttributes.