RadioList

Install

yarn add @ntds/radio

Import

import { RadioList } from '@ntds/radio';

Props

RadioList

PropType & 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"
Default value: "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

This guide is based on version: 1.9.0