Norsk Tipping Design System

SuffixInput

Install

yarn add @ntds/text-input

Import

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

Props

PropTypeDefaultDescription
id?string—The id of SuffixInput
valuestring—The value of the ExpDateInput
setValue(value: string) => void—Pass your setter from useState() directly here
disabled?boolean—Mark input as disabled
suffix?string—Custom 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?string—Visible label for the input
hint?string—Displays a hint under the input Note: Will not be shown if `error` is given as a string or a ReactNode.
onClear?() => void—Callback 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