Phone Input
Detected Country
A phone field with no country list: the country is detected from the code the person types after the "+" and shown as a chip on the right.
What you can change
- the field name through label and the code directory through countries
- the chip and focus color through accent
- the fallback glyph and wording for an unknown code
A link for your AI agent: preview, code and instructions.
Preview
Use it with AI
- 1. Copy the link.
- 2. Write to your agent in your own words and drop the link into the sentence.
- 3. The agent opens the link and installs the component from the registry.
put this on the home page as the hero:
https://vibeui.ru/c/phoneinput-004?lang=en&theme=dark
Not sure where to paste it? Step-by-step guide
Show the full instructions
What the link says, spelled out. Use it when your agent cannot open links — paste this text instead.
Loading…
For developers
The install command lives in the “Component source” block below — a signed link that stays valid for 24 hours.
Technical notes
A client component: the field value lives in useState, and the country is derived from it by the detect function. One file, zero dependencies, the palette in the local --vibeui-phoneinput-004-* variables. The match is found by the longest suitable code rather than the first one: +1 and +1242 differ only in length, and the short code must not win. The country chip is placed to the right of the input deliberately — on the left it would shift the caret on every detection. Until the code is recognised the field inserts nothing on its own: injecting over the input is the fastest way to ruin a typed number. The line under the field is marked aria-live="polite", so the recognised country is spoken.
Tags
- phone
- detect
- prefix
- client
Component source
The same file your agent installs. Here in case you would rather copy it by hand.
Loading…