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
- A number that is not a phone (an ID, a count): Input or Number field.
More examples
States and real uses. Each example is also a Storybook story and a visual regression test.
Phone input in field
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).localenames 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.