RadioList
Install
yarn add @ntds/checkboxImport
import { CheckboxList } from '@ntds/checkbox';Props
| Prop | Type | Default | Description |
|---|---|---|---|
name? | string | — | The name of the Checkbox. |
value | string[] | — | The current state of the checkboxesc |
setValue | (value: string[]) => void | — | Pass your setter from useState() directly here. |
horizontal? | boolean | — | If the CheckboxList should be displayed horizontally |
errorMessage? | string | ((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 CheckboxList Will not use aria-live Given as a `ReactNode`: Will render the content with margin dictated by the CheckboxList Use the `Message` component from @ntds /message |
hasError? | boolean | — | Toggle an errormessage below the CheckboxList |
onChange? | (event: ChangeEvent<HTMLInputElement, Element>) => void | — | A callback that gets triggered when a checkbox is clicked |
children | ReactNode | — | Usually simple text, but can be anything |