Norsk Tipping Design System

RadioItem

Install

yarn add @ntds/dropdown

Import

import { Dropdown } from '@ntds/dropdown';

Usage

<Dropdown
    items={() => (
        <>
            <Dropdown.Group>
                <Dropdown.ItemRadio
                checked={state === 'value'}
                onChange={value => setState(value)}
                value='value'
                >This is a Radio
                </Dropdown.ItemRadio>
                ...
            </Dropdown.Group>
        </>
    )}
    >
    ...
</Dropdown>

Props

PropTypeDefaultDescription
valuestringValue of the item
checked?booleanWhether or not the item is checked
onChange?(value: string) => voidA callback that gets triggered when an radioitem is clicked
childrenReactNodeUsually simple text, but can be anything.

On this page