HomeDocsComponentsBlocksChartsThemes
Introduction
  • Introduction
  • Installation
  • Themes
  • llms.txt
Components
  • Accordion
  • Alert
  • Alert Dialog
  • Amount
  • Aspect Ratio
  • Audio Player
  • Avatar
  • Avatar Upload
  • Badge
  • Banner
  • Breadcrumb
  • Button
  • Button Group
  • Calendar
  • Card
  • Carousel
  • Chart
  • Checkbox
  • Code Block
  • Collapsible
  • Color Picker
  • Combobox
  • Command
  • Context Menu
  • Copy Button
  • Countdown
  • Data Grid
  • Data Table
  • Date Picker
  • Date Range Picker
  • Description List
  • Device Mockup
  • Dialog
  • Direction
  • Dot Loader
  • Drawer
  • Dropdown Menu
  • Empty
  • Field
  • File Upload
  • Hover Card
  • Input
  • Input Group
  • Input OTP
  • Item
  • Kanban
  • Kbd
  • Label
  • Menubar
  • Meter
  • Multi Select
  • Native Select
  • Navigation Menu
  • Number Field
  • Pagination
  • Password Strength
  • Phone Input
  • Popover
  • Progress
  • Progress Circle
  • Radio Group
  • Rating
  • Resizable
  • Responsive Dialog
  • Rich Text Editor
  • Scroll Area
  • Segmented Control
  • Select
  • Separator
  • Sheet
  • Sidebar
  • Signature
  • Skeleton
  • Slider
  • Sortable
  • Spinner
  • Stat
  • Stepper
  • Switch
  • Table
  • Tabs
  • Tag Input
  • Terminal
  • Textarea
  • Time Field
  • Timeline
  • Toast
  • Toggle
  • Toggle Group
  • Tooltip
  • Tree
  • Typography
  • Video Player
  • Window Mockup
AI
  • Message Scroller
  • Message
  • Bubble
  • Marker
  • Attachment
  • Questionnaire
  • Composer
  • Reasoning
  • Tool Call
  • Approval Card
  • Citations
Blocks
  • Airtable
  • Airtable Kanban
  • ClickUp List
  • ClickUp Kanban
  • Repeatable Group
  • Command Palette
  • Sign In and Sign Up
  • Availability Scheduler
  • AI Chat
  • Action Bar
  • Notion
  • Banking
  • Lineup Builder
  • Sports Score
  • Strava
  • Sheets
  • Notices
  • Settings
  • Billing
Utilities
  • motion
  • sounds
  • scroll-fade
  • shimmer
Another UI. Built on shadcn/ui with Phosphor icons.

Phone Input

PreviousNext

A country picker with flags and dial codes, plus a number field that formats as you type. The value is E.164.

Base UIReact AriaRadix UI

Saved as +16045550142

Installation#

pnpm dlx shadcn@latest add https://anotherui.dev/r/phone-input.json

Usage#

import { PhoneInput } from "@/components/ui/phone-input"
<PhoneInput value={phone} onValueChange={setPhone} />
 
<PhoneInput defaultCountry="GB" countries={["GB", "IE", "CA"]} />

Value#

The value is E.164, like +16045550142. An empty field gives an empty string. onValueChange also gets the country and complete, which is true once every digit of the mask is filled.

Typing or pasting a number that starts with a plus picks the country from its dial code. Canada and the US share +1, so the current country wins when both match.

Countries#

A small table covers common countries, Canada and the US first. Each entry has a code, name, dial code and a mask where # is a digit. The masks are simple, so check numbers on the server if you need strict validation.

Props#

  • value, defaultValue and onValueChange hold the E.164 value.
  • defaultCountry is used when the value does not pick one. It defaults to CA.
  • countries limits the picker to a list of codes.
  • invalid and disabled style the whole group.
  • name adds a hidden input with the E.164 value for plain forms.
Password StrengthPopover

On This Page

InstallationUsageValueCountriesProps