Toggle Group

Group of toggle buttons for single or multiple selection. A highlight glides between choices, or neighbouring picks join into one continuous run.

Preview

Installation

npx @lumioui/cli add toggle-group

Usage

import { ToggleGroupItem, ToggleGroup } from "@/components/ui/toggle-group/toggle-group";
<ToggleGroup />

Also exported: ToggleGroupItem.

Examples

Multiple

The formatting bar of a field-notes editor.

Single

A map's layer picker.

API reference

ToggleGroup

Prop Type Default
type* "single" | "multiple"

Single select or multiple select.

—
value string | string[]

Controlled selected value(s). Omit with defaultValue for uncontrolled use.

—
defaultValue string | string[]

Initial value(s) for uncontrolled use.

—
onValueChange (value: string | string[]) => void

Called when the selection changes.

—
disabled boolean —
className string —
children React.ReactNode —

ToggleGroupItem

Prop Type Default
value* string —
disabled boolean —
className string —
textClassName string

Extra classes for a string label (weight, style, decoration).

—
children React.ReactNode —