Norsk Tipping Design System

PhoneNumberInput

Install

yarn add @ntds/text-input

Import

import { PhoneNumberInput } from '@ntds/text-input';

Props

PropTypeDefaultDescription
onKeyDown?(event: KeyboardEvent<HTMLInputElement>) => voidCall onKeyDown event handler if set
valuestringThe value of the
setValue(value: string) => voidPass your setter from useState() directly here
label?stringWhether the labels should be included.
placeholder?stringPlaceholder for input
hideIcon?booleanWhether the `Icon` should be displayed.
error?string | boolean | ((id: string) => ReactNode)Mark the input as invalid both visually and semantically Given as a `string`: Will render the message inside a Message component under the input Will not use aria-live Given as a `ReactNode`: Will render the content with margin dictated by the TextInput Use the `Message` component from @ntds /message
elementRef?Ref<HTMLInputElement>Get the DOM-reference from the TextInput-element
tw?TwGroupKeysTailwind overrides

On this page