Examples
Default
Filled
Error State
With Helper Text
All sizes
Props
PhoneField
A phone number input with a country selector (flag + chevron), a fixed dial code prefix, and atel input. The country picker itself is owned by the consumer: pass the selected countryโs flag and dialCode, and open your picker from onCountrySelect.
Provide at least one of label, aria-label, or aria-labelledby for accessibility โ a console warning is emitted in development if none are set.
string
default:"Select country"
Accessible name for the country selector button.
ReactNode
Dial code of the selected country, shown before the number (e.g.
"+39").boolean
default:"false"
Whether the field is in an error state.
string
Error message displayed below the input. Shown instead of
helperText when error is true.ReactNode
Flag of the selected country, rendered in the country selector (e.g. an image or flag icon).
boolean
default:"false"
Whether the field stretches to fill its container width.
string
Helper text displayed below the input. Replaced by
errorMessage when error is true.string
Label text displayed above the input. Also used as the accessible name.
(() => void)
Fired when the country selector (flag + chevron) is activated. Open the country picker here.
"32" | "40" | "48"
default:"48"
Height of the phone field in pixels.
Exported types
Also exported from@fanvue/ui: PhoneFieldProps, PhoneFieldSize.
Setup: Installation ยท Theming