Norsk Tipping Design System

PaymentOption

Install

yarn add @ntds/payment-selection

Import

import { PaymentSelection } from '@ntds/payment-selection';

Usage

<PaymentSelection
  label='Betalingsmåte'
  name='payment-selection'
  value={paymentOption}
  setValue={setPaymentOption}
>
    <PaymentSelection.Option
      value='Label'
      ...
    >
      Label
    </PaymentSelection.Option>
    ...
</PaymentSelection>

Props

PropTypeDefaultDescription
icon?ComponentType<{ size?: string; className?: string; }>Icon that will be displayed on the left side of the PaymentOption
name?stringName of PaymentOption. This name prop will be received from the Selection
subText?ReactNodeText that will be displayed below the main content.
twSubTextColor?TwClassNamesCustom color for the subText
srOnlyLabel?stringText to further describe the subText for the screen reader
valuestringValue of PaymentOption
checked?string | booleanWhether or not the checkbox is checked. Controlled by the Selection
onChange?(value: string) => voidA callback that gets triggered when a PaymentOption is clicked
childrenReactNodeUsually simple text, but can be anything. Pass in multiple elements to have them stacked in a column

On this page