Skip to main content

Phone Input

Conforms user input to a pre-defined phone number pattern.

Examples

NATP Phone Input

Accepts phone numbers formated for NATP (North American Telephone Plan). This is the default.

<PhoneInput />

International PhoneInput

Accepts phone numbers formated for international numbers with country codes.

<PhoneInput />

Props

NameTypeDefault ValueRequiredDescription
fieldClassNamestringNoA className to apply to the field.
fieldPropsRecord<string, unknown>NoAny props to spread onto the field container.
formatPhoneInputFormat | "nanp" | "intl"PhoneInputFormat.NANP (North American Numbering Plan)NoThe format to use for the phone number.
helperTextReactNodeNoA string or component to display as helper text beneath the input
iconEndstring | number | boolean | ReactElement<any, string | JSXElementConstructor<any>> | ReactFragment | ReactPortal | nullNoAn icon to render at the end of the input.
iconStartstring | number | boolean | ReactElement<any, string | JSXElementConstructor<any>> | ReactFragment | ReactPortal | nullNoAn icon to render at the front of the input.
labelReactNodeNoA string or component to display as a label above the input
multilinebooleanfalseNoShould a textarea be used instead of an input?
onChangeFormControlChangeEventHandler<InputType, string | number | readonly string[] | (string | number | readonly string[])[]> | undefinedNoEmit a new value when the input's selected value changes.
requiredbooleanfalseNoIs the field required?
resizebooleanfalseNoCan the textarea be resized?
rowsstring | numberNoHow many rows call should the multiline input be?
sizeundefinedFormControlSize.MediumNoThe size of the field
state"" | FormControlState | "critical" | "warning" | "success"FormControlState.DefaultNoThe state of the field

Enums

PhoneNumberFormat