ToggleButtonGroup
A group of toggle buttons that supports single and multiple selection modes with horizontal or vertical orientation.
Single Selection
Multiple Selection
Colors
Sizes
Text Formatting
A toolbar-style group with icon-only toggle buttons for text formatting.
Vertical
Props
| Prop | Type | Default | Description |
|---|---|---|---|
value | string | string[] | — | The selected value(s) (controlled). |
defaultValue | string | string[] | — | The initial selected value(s) (uncontrolled). |
onValueChange | (value: string | string[]) => void | — | Called when the selection changes. |
multiple | boolean | false | Allows multiple buttons to be selected simultaneously. |
orientation | "horizontal" | "vertical" | "horizontal" | Layout direction of the button group. |
color | "blue" | "red" | "green" | "yellow" | "purple" | "neutral" | string | "blue" | Accent color for selected buttons. |
size | "sm" | "md" | "lg" | "md" | Size preset for all buttons in the group. |
--mantle-bg | CSS variable | theme default | Override the background color via style. e.g. style={{ "--mantle-bg": "#1a1a2e" }} |
--mantle-border | CSS variable | theme default | Override the border color via style. Set to "transparent" to remove. e.g. style={{ "--mantle-border": "#e94560" }} |
--mantle-text | CSS variable | theme default | Override the text color via style. e.g. style={{ "--mantle-text": "#ffffff" }} |
--mantle-ring | CSS variable | accent | Override the focus ring color via style. e.g. style={{ "--mantle-ring": "#e94560" }} |
valuestring | string[]The selected value(s) (controlled).
defaultValuestring | string[]The initial selected value(s) (uncontrolled).
onValueChange(value: string | string[]) => voidCalled when the selection changes.
multiplefalsebooleanAllows multiple buttons to be selected simultaneously.
orientation"horizontal""horizontal" | "vertical"Layout direction of the button group.
color"blue""blue" | "red" | "green" | "yellow" | "purple" | "neutral" | stringAccent color for selected buttons.
size"md""sm" | "md" | "lg"Size preset for all buttons in the group.
--mantle-bgtheme defaultCSS variableOverride the background color via style. e.g. style={{ "--mantle-bg": "#1a1a2e" }}
--mantle-bordertheme defaultCSS variableOverride the border color via style. Set to "transparent" to remove. e.g. style={{ "--mantle-border": "#e94560" }}
--mantle-texttheme defaultCSS variableOverride the text color via style. e.g. style={{ "--mantle-text": "#ffffff" }}
--mantle-ringaccentCSS variableOverride the focus ring color via style. e.g. style={{ "--mantle-ring": "#e94560" }}