Skip to Content
πŸŽ‰ Hyperse HeroTelInput has been published.
DocumentationAPI Reference

API Reference

This article discusses the API and props of HeroTelInput. Props are defined within HeroTelInputProps.

NameTypeDefault
onChangeHeroTelInputOnChange

Gets called once the user updates the tel value.

The callback gives you 2 parameters:

  • The new tel value stringified
  • An object of different useful informations about the tel (country, extension, etc..)
forceCallingCodeboolean | undefined

Displays the calling code (e.g: +33) as read-only next to the flag and with a divider instead of as part of the input field. Needs defaultCountry prop to be defined or will default to US.

defaultCountryCountryCode

Sets the selected country on component mount

onlyCountriesCountryCode[]

Country codes to be included in the list of countries.

excludedCountriesCountryCode[]

Country codes to be excluded of the list of countries.

preferredCountriesCountryCode[]

Country codes to be highlighted to the top of the list of countries.

disableDropdownboolean

No country list / The current flag is a span instead of a button.

langOfCountryNamestring

An Intl locale to translate country names (see Intl locales). All countries will be translated in this language.

disableFormattingboolean

Remove format (spaces..) from the input value.

false
focusOnSelectCountryboolean

Autofocus the input when the user selects a country in the list.

true
continentsHeroTelInputContinent[]

Continent codes to include a group of countries.

unknownFlagElementReact.ReactNode

This prop let you to customize the unknown flag, changed the width or height, use CDN or SVG component, etc..

searchAriaLabelstring

The aria-label of the search input.

"Search countries"
searchPlaceholderstring

The placeholder of the search input.

"Search countries..."
activedCountryInTopboolean

The actived country code to be highlighted to the top of the list of countries.

true

Custom classNames

NameTypeDefault
dialogstring
dialogContentstring
textFieldstring
searchInputstring
overlaystring
inputSlotsToClasses<"description" | "errorMessage" | "label" | "base" | "input" | "mainWrapper" | "inputWrapper" | "innerWrapper" | "clearButton" | "helperWrapper"> | undefined
Last updated on