Docs
Phone Input

Phone Input

Input field for phone numbers with country code selection.

Enter a phone number to see it here

Examples

Default

Enter a phone number to see it here

Disabled

Clearable

Phone number: +14155552671

Installation

Usage

import { PhoneInput } from "@/components/ui/phone-input";
<PhoneInput
  value={phoneNumber}
  onChange={setPhoneNumber}
  placeholder="Enter your phone number"
  defaultCountry="US"
/>

Props

PropTypeDefaultDescription
classNamestring-The class name to apply to the component.
placeholderstringEnter phone numberPlaceholder text for the input field.
onChange(value: string) => void-Callback when phone number value changes.
valuestring-The phone number value.
clearablebooleanfalseWhether to show a clear button.
onClear() => void-Callback when clear button is clicked.
clearClassNamestring-Class name to apply to the clear button.
defaultCountrystring-The default country code (e.g., "US").
fallbackCountrystring"AU"The fallback country if no default is provided.
disabledbooleanfalseWhether the input is disabled.