RadioList
Install
yarn add @ntds/radioImport
import { RadioList } from '@ntds/radio';Props
| Prop | Type | Default | Description |
|---|---|---|---|
name | string | — | The name for the list of radios. This prop will be propagated to each radio element |
value | string | — | The value of the checked radio |
horizontal? | boolean | — | If the RadioList should be displayed horizontally |
labelPosition? | "right" | "bottom" | right | Position of label |
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 RadioList Will not use aria-live Given as a `ReactNode`: Will render the content with margin dictated by the RadioList Use the `Message` component from @ntds /message |
hasError? | boolean | — | Toggle an errormessage below the RadioList |
onChange | (value: string) => void | — | A callback that gets triggered when a radio is clicked |
children | ReactNode | — | Usually simple text, but can be anything |