XiodUI
HomeDocs
OverviewComponentsStyling & CustomizationChangelog

Components

  • Accordion
  • Agent Steps
  • Alert
  • Alert Dialog
  • Aspect Ratio
  • Autocomplete
  • Avatar
  • Badge
  • Breadcrumb
  • Button
  • Button Group
  • Button Split
  • Calendar
  • Card
  • Carousel
  • Checkbox
  • Circular Progress
  • Collapsible
  • Color Picker
  • Combobox
  • Command
  • Context Menu
  • Copy To Clipboard
  • Corner Badge
  • Dashboard Grid
  • Date Picker
  • Dialog
  • Dot Matrix
  • Draggable
    Updated
  • Drawer
  • Empty
  • Field
  • Fieldset
  • File Upload
    Updated
  • Form
  • Frame
  • Gauge
  • Grid
  • Group
  • Input
  • Input Group
  • Input OTP
  • Input Payment
  • Input Phone
    Updated
  • Input Sensitive
  • Kbd
  • Kinetic Click
  • Label
  • List Box
    Updated
  • Loader
  • Marker
  • Menu
  • Menubar
  • Message
  • Meter
  • Morphic Toast
  • Navigation Menu
  • Number Field
  • Option Picker
  • Orb
  • Pagination
  • Popover
  • Preview Card
    Updated
  • Progress
  • Radio
  • Resizable
  • Ruler Picker
  • Scroll Area
  • Scroll Bar
  • Select
  • Separator
  • Sidebar
  • Skeleton
  • Slider
  • Sortable
  • Switch
  • Table
  • Tabs
  • Text
  • Textarea
  • Timeline
  • Toast
  • Toggle
  • Toggle Group
  • Toolbar
  • Tooltip
  • Waveform
  • Wheel Picker

Loading...

Preview Skeleton

Installation Skeleton

Usage Skeleton

API Reference Skeleton

Sponsors

Support the development of XiodUI and help us build the best component library on Earth.

+++
Sponsor on GitHub

Input Phone

Previous: Input PaymentNext: Input Sensitive

A phone number input with a country picker and formatting, submitted in E.164 format.

Preview

Loading Preview...

Installation

bun add xiod-ui

Usage

Imports

1import {2  InputPhone,3  InputPhoneCountrySelect,4  InputPhoneFlag,5  InputPhoneInput6} from "xiod-ui/input-phone";

API Reference

Detailed documentation of properties and options.

InputPhone

alias: PhoneInput

Accepts render, plus every native attribute of the element it renders.

PropTypeDefaultDescription
countries
CountryData[]
[ { code: "US", name: "United States", dialCode: "+1", flag: "🇺🇸", mask: "(###) ###-####", }, { code: "GB", name: "United Kingdom", dialCode: "+44", flag: "🇬🇧", mask: "##### ######", }, { code: "IN", name: "India", dialCode: "+91", flag: "🇮🇳", mask: "##### #####", }, { code: "CA", name: "Canada", dialCode: "+1", flag: "🇨🇦", mask: "(###) ###-####", }, { code: "AU", name: "Australia", dialCode: "+61", flag: "🇦🇺", mask: "#### ### ###", }, { code: "DE", name: "Germany", dialCode: "+49", flag: "🇩🇪", mask: "#### ########", }, { code: "FR", name: "France", dialCode: "+33", flag: "🇫🇷", mask: "# ## ## ## ##", }, { code: "JP", name: "Japan", dialCode: "+81", flag: "🇯🇵", mask: "## #### ####", }, { code: "BR", name: "Brazil", dialCode: "+55", flag: "🇧🇷", mask: "(##) #####-####", }, { code: "CN", name: "China", dialCode: "+86", flag: "🇨🇳", mask: "### #### ####", }, { code: "ES", name: "Spain", dialCode: "+34", flag: "🇪🇸", mask: "### ## ## ##", }, { code: "IT", name: "Italy", dialCode: "+39", flag: "🇮🇹", mask: "### #######", }, { code: "MX", name: "Mexico", dialCode: "+52", flag: "🇲🇽", mask: "### ### ####", }, { code: "NL", name: "Netherlands", dialCode: "+31", flag: "🇳🇱", mask: "# ########", }, { code: "SG", name: "Singapore", dialCode: "+65", flag: "🇸🇬", mask: "#### ####", }, { code: "KR", name: "South Korea", dialCode: "+82", flag: "🇰🇷", mask: "## #### ####", }, { code: "ZA", name: "South Africa", dialCode: "+27", flag: "🇿🇦", mask: "## ### ####", }, { code: "AE", name: "United Arab Emirates", dialCode: "+971", flag: "🇦🇪", mask: "## ### ####", }, { code: "AR", name: "Argentina", dialCode: "+54", flag: "🇦🇷", mask: "### ###-####", }, { code: "CH", name: "Switzerland", dialCode: "+41", flag: "🇨🇭", mask: "## ### ## ##", }, { code: "SE", name: "Sweden", dialCode: "+46", flag: "🇸🇪", mask: "##-### ## ##", }, { code: "NO", name: "Norway", dialCode: "+47", flag: "🇳🇴", mask: "### ## ###", }, { code: "DK", name: "Denmark", dialCode: "+45", flag: "🇩🇰", mask: "## ## ## ##", }, { code: "FI", name: "Finland", dialCode: "+358", flag: "🇫🇮", mask: "## ### ## ##", }, { code: "NZ", name: "New Zealand", dialCode: "+64", flag: "🇳🇿", mask: "## ### ####", }, { code: "PL", name: "Poland", dialCode: "+48", flag: "🇵🇱", mask: "### ### ###", }, { code: "PT", name: "Portugal", dialCode: "+351", flag: "🇵🇹", mask: "### ### ###", }, { code: "IE", name: "Ireland", dialCode: "+353", flag: "🇮🇪", mask: "## ### ####", }, { code: "BE", name: "Belgium", dialCode: "+32", flag: "🇧🇪", mask: "### ## ## ##", }, { code: "AT", name: "Austria", dialCode: "+43", flag: "🇦🇹", mask: "#### ######", }, { code: "IL", name: "Israel", dialCode: "+972", flag: "🇮🇱", mask: "##-###-####", }, { code: "SA", name: "Saudi Arabia", dialCode: "+966", flag: "🇸🇦", mask: "## ### ####", }, { code: "TH", name: "Thailand", dialCode: "+66", flag: "🇹🇭", mask: "## #### ####", }, { code: "MY", name: "Malaysia", dialCode: "+60", flag: "🇲🇾", mask: "##-### ####", }, { code: "ID", name: "Indonesia", dialCode: "+62", flag: "🇮🇩", mask: "###-####-####", }, { code: "PH", name: "Philippines", dialCode: "+63", flag: "🇵🇭", mask: "### ### ####", }, { code: "VN", name: "Vietnam", dialCode: "+84", flag: "🇻🇳", mask: "### ### ####", }, { code: "GR", name: "Greece", dialCode: "+30", flag: "🇬🇷", mask: "### #######", }, { code: "TR", name: "Turkey", dialCode: "+90", flag: "🇹🇷", mask: "### ### ## ##", }, { code: "UA", name: "Ukraine", dialCode: "+380", flag: "🇺🇦", mask: "## ### ## ##", }, { code: "CZ", name: "Czech Republic", dialCode: "+420", flag: "🇨🇿", mask: "### ### ###", }, { code: "HU", name: "Hungary", dialCode: "+36", flag: "🇭🇺", mask: "## ### ####", }, { code: "RO", name: "Romania", dialCode: "+40", flag: "🇷🇴", mask: "### ### ###", }, { code: "CL", name: "Chile", dialCode: "+56", flag: "🇨🇱", mask: "# #### ####", }, { code: "CO", name: "Colombia", dialCode: "+57", flag: "🇨🇴", mask: "### ### ####", }, { code: "PE", name: "Peru", dialCode: "+51", flag: "🇵🇪", mask: "### ### ###", }, { code: "EG", name: "Egypt", dialCode: "+20", flag: "🇪🇬", mask: "## #### ####", }, { code: "NG", name: "Nigeria", dialCode: "+234", flag: "🇳🇬", mask: "### ### ####", }, { code: "KE", name: "Kenya", dialCode: "+254", flag: "🇰🇪", mask: "### ######", }, ]
Input PaymentInput Sensitive

The countries the user can choose from. Defaults to the built-in list, exported as COUNTRIES.

defaultCountry
string
US

The code of the country selected at first, such as "US", when no number sets it.

defaultValue
string
–

The number at first, when it isn't controlled, in E.164 format such as "+15550000000". Its dialling code picks the country.

disabled
boolean
–

Whether the component should ignore user interaction.

labels
Partial<InputPhoneLabels>
–

Replaces the built-in text for this instance. See LabelsProvider to change it everywhere.

name
string
–

Submits the E.164 value (e.g. "+15550000000") with a form under this name.

onChange
((e164: string, country: CountryData, nationalNumber: string) => void)
–

Called when the number or country changes, with the full number in E.164 format, the selected country, and the digits typed without the dialling code.

readOnly
boolean
–

Whether the value can be seen but not changed.

required
boolean
–

Whether a number is required to submit the form. Applies to the hidden input written under name.

size
"lg"|"sm"|"default"
default

The size of the component.

value
string
–

The number in E.164 format, such as "+15550000000". Use with onChange to control it.

variant
"default"|"ghost"|"filled"
default

The visual style of the component.

InputPhoneCountrySelect

alias: PhoneInputCountrySelect

Accepts render, plus every native attribute of the element it renders.

PropTypeDefaultDescription
clearIcon
ReactNode
–

Replaces this icon. Accepts any node; null renders no icon. Takes precedence over IconProvider.

searchIcon
ReactNode
–

Replaces this icon. Accepts any node; null renders no icon. Takes precedence over IconProvider.

selectedIcon
ReactNode
–

Replaces this icon. Accepts any node; null renders no icon. Takes precedence over IconProvider.

triggerIcon
ReactNode
–

Replaces this icon. Accepts any node; null renders no icon. Takes precedence over IconProvider.

InputPhoneFlag

alias: PhoneInputFlag

Accepts render, plus every native <span> attribute.

PropTypeDefaultDescription
code
string
–

The code of the country whose flag to show, such as "GB". Defaults to the selected country.

InputPhoneInput

alias: PhoneInputInput

Accepts className, style and render, plus every native attribute of the element it renders.

PropTypeDefaultDescription
clearIcon
ReactNode
–

Replaces this icon. Accepts any node; null renders no icon. Takes precedence over IconProvider.

defaultValue
string | number | readonly string[]
–

The default value of the input. Use when uncontrolled.

nativeInput
boolean
–

Whether to render a plain <input> instead of Base UI's Input. A plain input doesn't register with a surrounding Field.

onValueChange
((value: string, eventDetails: Input.ChangeEventDetails) => void)
–

Callback fired when the value changes. Use when controlled.

size
number|"lg"|"sm"|"default"
default

The size of the component.

unstyled
boolean
–

Whether to drop the border, background and focus ring, leaving only the text field. Use inside your own styled container.