ToggleGroup
Set of related toggle buttons allowing single or multiple selection within the group.
Examples
Text alignment
Single-select group for text alignment.
View mode
Grid / List toggle with icon symbols.
With icons (multi-select)
Format toolbar supporting multiple active states at once.
Single select (pill)
Segmented control style. Moving highlight indicates selection.
Installation
pnpm add @rokle/components @rokle/tokensInstalls with the default Rokle brand. Generate a custom brand on rokle.app to use your own colours and personality.
Usage
import { ToggleGroup } from "@rokle/components";import { ToggleGroup } from "@rokle/components";
export function Example() {
return <ToggleGroup />;
}API Reference
| Prop | Type | Default | Description |
|---|---|---|---|
| items | { label: string; value: string; icon?: ReactNode }[] | - | Toggle group items. |
| value | string | string[] | - | Selected value or values. |
| type | "single" | "multiple" | "single" | Whether one or multiple items can be active. |