Skip to content

Phone Input

Shared label and supporting-text behaviour is summarised on Inputs overview.

catnip-input-phone

Props

Value & country selection

PropTypeDefaultOptionsDescription
modelValue{ countryCode: string; countryIsoCode: string; phoneNumber: string } | nullnullPhone value; countryCode is the dial prefix (e.g. "+47"), and countryIsoCode disambiguates countries sharing a prefix.
defaultCountryCodestring"auto"ISO code, dial prefix, or autoCountry used when modelValue.countryIsoCode is absent. auto uses browser locale, then NO.
placeholderstring""Placeholder for the phone-number text field.
autocompletestring"tel"Native autocomplete on the telephone input.
showClearButtonbooleanfalseShows a clear control when a phone number is present.

Country list

PropTypeDefaultOptionsDescription
openbooleanControlled open state for the country picker.
filterValuestringControlled search text for the country picker.
filterPlaceholderstring""Search placeholder; defaults to bundled locale copy.
listMaxHeightstring | number"280px"Max height for the scrollable country list body.

Field presentation

PropTypeDefaultOptionsDescription
labelstring""Visible label text when the label slot is empty.
optionalbooleanfalseShows optional hint on the label when not required.
optionalTextstring""Overrides optional hint text (HTML: optional-text).
infostring""Info tooltip on the label (info wins over the label.suffix slot when both are set).
alignmentstring"left"left, center, rightLabel alignment.
requiredMarkerstring"*"Visual required marker (HTML: required-marker).
requiredScreenReaderTextstring""Supplemental screen-reader text for required fields (HTML: required-screen-reader-text).
supportingTextstring | string[] | { text, intent?, icon? } | { text, intent?, icon? }[]Message(s) below the field. See Inputs overview — Multiple supporting messages.

State

PropTypeDefaultOptionsDescription
sizestring"m"s, m, lDimensions and typography.
intentstring"neutral"neutral, warning, danger, successStatus styling; danger sets aria-invalid on the telephone input.
disabledbooleanfalseDisables the country picker and telephone input.
readonlybooleanfalseMakes the control read-only and prevents country-picker changes.
requiredbooleanfalseNative required on the telephone input and label marker.
ariaLabelstring""aria-label for the telephone input when there is no visible label.
ariaDescribedbystring""Extra id values merged into aria-describedby alongside generated supporting-text ids.

Advanced

PropTypeDefaultOptionsDescription
idstring""DOM id for the telephone input.
namestring""Native form name on the form-associated CE.
autofocusbooleanfalseAutofocus (use sparingly).
hideLabelbooleanfalseHides the built-in label row.
clearButtonAriaLabelstring""Accessible label for clear; defaults to bundled locale copy.
countryButtonAriaLabelstring""Accessible label for the country picker button/list.
testSelectorsobjectSee Test selectorsOverrides for data-test.

Events

NamePayloadDescription
update:modelValue{ countryCode: string; countryIsoCode: string; phoneNumber: string } | nullValue changed.
update:openbooleanCountry picker open state changed.
update:filterValuestringCountry search text changed.
closeCountry picker closed.

Slots

NameDescription
labelCustom label content; falls back to label prop.
label.actionTrailing action in the label row (e.g. link).
label.suffixCustom label suffix (suffix slot); used only when info is empty.

Test selectors

AttributeDefaultApplies to
rootcatnip-input-phoneField wrapper
controlcatnip-input-phone-controlNative telephone input
countryButtoncatnip-input-phone-country-buttonCountry picker button
countryFlagcatnip-input-phone-country-flagTrigger/list flag
countryDialCodecatnip-input-phone-country-dial-codeCountry list dial code
chevroncatnip-input-phone-chevronCountry picker chevron
clearButtoncatnip-input-phone-clearClear control
supportingTextcatnip-input-phone-supporting-textSupporting message
floatingPanel{ root: "catnip-floating-panel" }Floating country panel
list{ root, header, body, footer }Internal country list
filterInput{ root, control, icon }Search row
optioncatnip-input-phone-optionCountry list row

Catnip Design System by Signicat