Toggle Group

A set of two-state buttons that can be toggled on or off. Supports single and multiple selection modes.

Text Alignment

Text Decoration

The quick brown fox jumps over the lazy dog.

Installation

CLI

Install the component using the StarUI CLI:

star add toggle-group

Examples

View Mode Switcher

Switch between grid, list, and card layouts. Each mode shows different content via data_show bound to the group signal.

View Mode

Inception (2010)
The Matrix (1999)
Interstellar (2014)
Blade Runner (1982)
Inception (2010)
The Matrix (1999)
Interstellar (2014)
Blade Runner (1982)

Inception

2010 · Sci-Fi · 2h 28m

The Matrix

1999 · Sci-Fi · 2h 16m

Multi-Select Filters

Use type='multiple' for non-exclusive selections. The collect() helper joins active filter names into a summary string.

Active:

Form Integration

Chain toggle groups with conditional visibility — the frequency selector appears only after choosing at least one communication method. Uses orientation='vertical' for the second group.

Notification Preferences

Summary:

Disabled

Pass disabled=True to prevent interaction on all items. Renders with reduced opacity.

API Reference

Component Description
ToggleGroup A toggle group with single or multiple selection. Pass items as (value, content) tuples. Selection state is stored in the signal directly (str for single, list[str] for multiple).