Skip to content

Toggle Group

Primitives

A segmented control for switching between views or toggling multiple options. Supports single and multi-select modes with size variants.

atlas-toggle-group

Examples

Single selection

Bind [(value)] to a signal; one item stays selected.

Selected: week

Multiple selection and sizes

With multiple , the value is an array. size takes sm , md or lg .

Selected: bold

Icon-only items and disabled items

An icon alone gives a button no name: set ariaLabel on icon-only items. disabled items stay visible but cannot be chosen.

Layout: grid (the board view needs a paid plan)

API

Generated from the library source, so it always matches the code.

AtlasToggleGroupComponent atlas-toggle-group

InputTypeDefaultDescription
items requiredToggleGroupItem[]— Toggle items to display
value two-waystring | string[]'' Currently selected value(s). Use string for single, string[] for multiple.
multiple booleanfalse Whether multiple items can be selected
size ToggleGroupVariants['size']'md' Size variant
ariaLabel string | undefinedundefined Aria label for the group
class string'' Additional CSS classes

Types

ToggleGroupItem

PropertyTypeDescription
value string Unique value
label? string Display label (optional if icon is provided)
icon? string Optional icon name
ariaLabel? string Accessible name of an icon-only item (no label ). Without it the item is named by its value , since an icon alone gives the button no name.
disabled? boolean Whether this item is disabled

ToggleGroupVariants

type ToggleGroupVariants = VariantProps<typeof toggleGroupVariants>