Norsk Tipping Design System

SuffixInput

Install

yarn add @ntds/text-input

Import

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

Props

PropTypeDefaultDescription
id?stringThe id of SuffixInput
valuestringThe value of the ExpDateInput
setValue(value: string) => voidPass your setter from useState() directly here
disabled?booleanMark input as disabled
suffix?stringCustom suffix
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
label?stringVisible label for the input
hint?stringDisplays a hint under the input Note: Will not be shown if `error` is given as a string or a ReactNode.
onClear?() => voidCallback that displays a button - `CloseIcon` - on the left side of the input.
elementRef?Ref<HTMLInputElement>Get the DOM-reference from the TextInput-element

On this page