Skip to content

Toggle Board

A bank of tactile keys holds independent selections with illuminated indicators.

LIVE PREVIEWInteract with the component
Just React. No extra dependencies.

Copy the component and its CSS module into your project.

CSS Modules

Usage

Matches your current playground settings.

jsx
import ToggleBoard from "./ToggleBoard";
export default function Example() {
return (
<ToggleBoard
items={[
{
"value": "grain",
"label": "Grain"
},
{
"value": "bloom",
"label": "Bloom"
},
{
"value": "motion",
"label": "Motion"
},
{
"value": "depth",
"label": "Depth"
},
{
"value": "texture",
"label": "Texture"
},
{
"value": "light",
"label": "Light"
}
]}
defaultValue={[
"grain",
"motion",
"light"
]}
columns={3}
color={"#d7a877"}
label={"Effects"}
disabled={false}
/>
);
}

Using Toggle Board

Give each item a unique value and a short label. Each key is an independent pressed button, so multiple options can be selected at once.

Pass value and onValueChange to integrate the board with application state. Use item.disabled for individual unavailable choices or disabled for the entire group.

Props

NameTypeRequiredDefaultDescription
itemsArray<{ value, label, icon?, disabled? }>No[]Options with unique values and optional icons or disabled states.
valueArray<string>NoundefinedControlled array of selected values.
defaultValueArray<string>No[]Initial selected values in uncontrolled mode.
onValueChangefunctionNoundefinedReceives the complete next array of selected values.
columnsnumberNo3Number of columns, from 1 to 6.
colorstringNo"#d7a877"Illuminated indicator and focus colour.
labelstringNo"Options"Accessible group label.
disabledbooleanNofalseDisable every key.
classNamestringNo""Additional classes on the root element.
styleCSSPropertiesNoundefinedInline styles for sizing, typography and appearance.

Related components

A recessed password field pairs a reveal control with an optional strength indicator.

Editable tags collect inside a softly framed input with individual remove controls.

A recessed search field expands into a polished capsule as you type.

Faceted stars lift into selection with a small marker beneath the chosen rating.