Phone Input

A telephone number field with type tel, a numeric keypad on mobile, tel autocomplete, tabular digits and a default aria label. Styled like the React base input.

src/registry/ui/phone-input.tsx/r/phone-input.json

Installation#

bash
npx shadcn@latest add @minidev/phone-input

MiniDev UI is in the shadcn registry directory, so the short form works with no setup. Older CLI versions can use the full URL: npx shadcn@latest add https://ui.minidev.pro/r/phone-input.json

Usage#

tsx
import { PhoneInput } from "@/components/ui/phone-input"

export function Example() {
  return (
    <PhoneInput aria-label="Phone" />
  )
}

API reference#

PhoneInput props
PropTypeDefault
valuestring-
onChange(value: string) => void-
disabledboolean-
classNamestring-
idstring-
aria-labelstring-
placeholderstring"+1 (555) 000-0000"

Dependencies#

npm

React only

Built from

Examples#

All form components