A set of two-state buttons that can be toggled on or off. Supports single and multiple selection modes.
Text Formatting
Selected format:
Installation
CLI
Install the component using the StarUI CLI:
star add toggle-groupExamples
View Mode Switcher
Toggle between different content layouts with dynamic content display
View Mode
Item 1
Description for item 1
Item 2
Description for item 2
Multi-Select Filters
Multiple selection toggle group for filtering options
Filter Options
Active Filters:
Size Variations
Toggle groups in different sizes for various use cases
Small
Default
Large
Editor Controls
Combine single and multiple selection groups for rich text editing
Text Alignment
Text Decoration
The quick brown fox jumps over the lazy dog. This sample text demonstrates the selected text alignment and decoration options.
Variant Styles
Different visual styles and combinations with icons
Default Variant
Outline Variant
With Icons
Form Integration
Complex form scenarios with multiple toggle groups and live feedback
Notification Preferences
Summary:
Methods:
Frequency:
Disabled States
Toggle groups in disabled states for different scenarios
Disabled States
Dynamic Disabling
Fully Disabled
API Reference
| Component | Description |
|---|---|
ToggleGroup |
A toggle group with single or multiple selection. Pass items as (value, content) tuples. Selection is exposed as `{signal}_value` (str for single, list[str] for multiple). |