ArrayRadioInputs()function

ArrayRadioInputs({
	value,
	onValue,
	required = false,
	items,
	formatter = formatValue,
	...props
}: ArrayRadioInputsProps<T>): ReactElement
ParamType
propsArrayRadioInputsProps<T>
Props for ArrayRadioInputs, which renders a radio for each item in an array of values. required
    .itemsImmutableArray<T>
Array of values to show in the list of radios. required
    .formatter((value: T) => ReactNode)
Function that formats an obscure item into a ReactNode for display.
Return
ReactElement
Element rendering one radio per item plus an optional empty placeholder radio.

Output a list of <RadioInput> elements for each item in an array.

  • The items can be any type, and can be formatted for output through an optional formatter() function.
  • A placeholder option is shown at the bottom if required=false.

Examples

<ArrayRadioInputs name="size" items={["s", "m", "l"]} value={size} onValue={setSize} />