Toggle Group

A group of two-state buttons that can be used to select one or more options.

Default

The standard toggle group component.

Installation & Usage

Installation

Imports

Basic Skeleton

Examples

Colors

Customize toggle group items with Tailwind CSS classes to create themed selections.

Success Theme
Destructive Theme
Info Theme

Outline

Single Selection

Sizes

Small (size="sm")
Large (size="lg")

Disabled

Spacing

Reactive Forms

Selected Action: star

API Reference

Helm API

The Helm component provides the spartan/ui styling for the toggle group.

DirectiveSelectorDescription
HlmToggleGroupDirective[hlmToggleGroup]Main directive for the toggle group container.
HlmToggleGroupItemDirective[hlmToggleGroupItem]Directive for each item within the toggle group.

Brain API

The Brain component handles the logic and accessibility for the toggle group.

PropertyTypeDescription
type'single' | 'multiple'Whether single or multiple items can be selected.
valueanyThe current value(s) of the toggle group.
disabledbooleanWhether the toggle group is disabled.