Checkboxes with a description
Checkboxes where one radio has an additional description
import { useState } from 'react';
import { Checkboxes } from '@citizensadvice/react-combo-boxes';
const options = [
{ label: 'Apple' },
{ label: 'Orange' },
{ label: 'Lemon', description: 'Great for humous' },
{ label: 'Raspberry' },
{ label: 'Strawberry' },
];
export function Example() {
const [values, setValues] = useState(null);
return (
<>
<fieldset className="radios">
<legend>What is your favourite fruit</legend>
<Checkboxes
id="checkboxes"
values={values}
onValues={setValues}
options={options}
/>
</fieldset>
<label htmlFor="output">Current value</label>
<output id="output">{JSON.stringify(values, undefined, ' ')}</output>
</>
);
}