Norsk Tipping Design System

PhoneNumberInput

Install

yarn add @ntds/text-input

Import

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

Props

PropTypeDefaultDescription
onKeyDown?(event: KeyboardEvent<HTMLInputElement>) => void—Call onKeyDown event handler if set
valuestring—The value of the
setValue(value: string) => void—Pass your setter from useState() directly here
label?string—Whether the labels should be included.
placeholder?string—Placeholder for input
hideIcon?boolean—Whether 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?TwGroupKeys—Tailwind overrides

On this page