Skip to content
Design System
GitHub

Phone input

v0.23.0Beta

A phone number with its country, formatted as you type, stored as E.164.

Stored as: —

Phone input default

Install
npx shadcn add @syncrobotic/phone-input

Also installs: libphonenumber-js, @syncrobotic/cn, @syncrobotic/field, @syncrobotic/select

Overview

A country picker joined to a phone field that formats the number as it is typed and gives back an international (E.164) number.

When to use

  • On-call numbers for alarm escalation.
  • Site and customer contacts.

Use something else

More examples

States and real uses. Each example is also a Storybook story and a visual regression test.

Gets a call when a critical alarm is not acknowledged in 2 minutes.

Phone input in field

This number is incomplete for Taiwan.

Phone input validated

Phone input other country

Phone input limited countries

Phone input read only

Phone input disabled

Usage rules

  • Store and send the E.164 value (+886912345678), never the formatted text.
  • Validate on blur or submit with isPhoneValid, through Field's error.

Changelog

  • 0.23.02026-11-20Every word it says can be translated without editing the source: labels (country, phoneNumber). locale names and sorts the countries in that language (English when left out, as before).
  • 0.17.32026-11-19Disabled: the field keeps its grey fill with a --border edge, so in dark mode it no longer looks enabled; its words use the new --disabled (3:1 on every surface). Read-only and disabled draw one continuous outline (the country segment had none).
  • 0.17.22026-11-19A comment says where keyboard focus shows instead of the removed outline (no change in behaviour); checked by lint:rules.

How to upgrade