MultiSelectionButtons

Multi selection buttons

<MultiSelectionButtons>
<SelectionButton value="id1">Test 1</SelectionButton>
<SelectionButton value="id2">Test 2</SelectionButton>
<SelectionButton value="id3">Test 3</SelectionButton>
</MultiSelectionButtons>

Props

PropTypeDefaultDescription
onChange([string | number]) => voidA function triggered when an item is selected/changed. The single parameter it recieves contains the value(s) of the selected item(s)
value[string | number]Control the selected item by manually setting the value(s)

Examples

Basic

() => {
const [state, setState] = React.useState(['id1']);
const onChange = (value) => {
console.log(value)
setState(value)
}
return (
<MultiSelectionButtons value={state} onChange={onChange}>
<SelectionButton value="id1">Test 1</SelectionButton>
<SelectionButton value="id2">Test 2</SelectionButton>
<SelectionButton value="id3">Test 3</SelectionButton>
<SelectionButton value="id4">Test 4</SelectionButton>
</MultiSelectionButtons>
);
};