Skip to content

Phone Input ​

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

catnip-input-phone ​

Props ​

Value & country selection ​

PropTypeDefaultOptionsDescription
modelValueCatnipInputPhoneModelValuenull—Phone 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.
showClearButtonbooleanfalse—Shows a clear control when a phone number is present.

Country list ​

PropTypeDefaultOptionsDescription
openboolean——Controlled open state for the country picker. Pair with open-change.
filterValuestring——Controlled 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 field label when the label slot is empty.
optionalbooleanfalse—When true and not required, shows the localized optional hint.
optionalTextstring""—Overrides the localized optional hint (HTML: optional-text).
infostring""—Info tooltip beside the label; when non-empty, it wins over the label.suffix slot.
alignment"left" | "center" | "right""left"left, center, rightHorizontal alignment of the field label block.
requiredMarkerstring"*"—Visual marker for required fields (HTML: required-marker).
requiredScreenReaderTextstring""—Optional screen-reader supplement; it does not replace required on the control (HTML: required-screen-reader-text).
supportingTextSupportingTextProp""—One or more helper or validation messages. Each object requires text; intent accepts neutral, danger, warning, or success, and icon accepts a Catnip icon name. See supporting-text examples.

State ​

PropTypeDefaultOptionsDescription
size"s" | "m" | "l""m"s, m, lDimensions and typography.
intent"neutral" | "danger" | "warning" | "success""neutral"neutral, danger, warning, successSemantic state applied to field and supporting-text styling; danger sets aria-invalid on the telephone input.
disabledbooleanfalse—Disables the country picker and telephone input.
readonlybooleanfalse—Makes the control read-only and prevents country-picker changes.
requiredbooleanfalse—Native 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.
autofocusbooleanfalse—Autofocus (use sparingly).
hideLabelbooleanfalse—Hides the built-in label row.
clearButtonAriaLabelstring""—Accessible label for clear; defaults to bundled locale copy.
countryButtonAriaLabelstring""—Accessible label for the country picker button/list.
testSelectorsTestSelectorsPropSee Test selectors—Overrides stable data-test values.

Events ​

NamePayloadDescription
update:modelValue{ countryCode: string; countryIsoCode: string; phoneNumber: string } | nullValue changed.
open-changebooleanCountry picker open state changed. Use @open-change.
update:filterValuestringCountry search text changed.
close—Country 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