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
RadioItem
Prop | Type & Description |
---|---|
value | string Value of the item |
checked | boolean Whether or not the item is checked |
onChange | (value: string) => void A callback that gets triggered when an radioitem is clicked |
children | ReactNode Usually simple text, but can be anything. |