InputPhone

atoms

Phone number input with country code selector. Format validation.

ARIA Role: group

Demo

Please enter a valid value

Props

PropTypeRequiredDefaultDescription
valuestringNoPhone number value
onChange(value: string) => voidYesValue change handler
defaultCountrystringNo'CA'Default country code
disabledbooleanNofalseDisabled state
errorstringNoValidation error

TypeScript Interface

interface InputPhoneProps {
  value?: string;
  onChange: (value: string) => void;
  defaultCountry?: string;
  disabled?: boolean;
  error?: string;
}

Assertions (NASA Rule 5)

  • [type]countryCode must be ISO 3166-1 alpha-2(ISO 3166-1)
  • [validation]E.164 format: +[country code][number], max 15 digits(ITU-T E.164)
  • [aria]Provide aria-invalid when validation fails(WCAG 1.3.1)
  • [aria]Format hint must be linked via aria-describedby(WCAG 3.3.2)

Usage

Import

import { Inputphone } from '@epasslive/design-system'

Basic

<Inputphone />

With Variants

<Inputphone variant="primary" size="md" />