Acronis UIKit
Legacy (shadcn-uikit)Components

Toggle Group

A group of toggle buttons where one or multiple items can be pressed.

Usage

import { ToggleGroup, ToggleGroupItem } from '@acronis-platform/shadcn-uikit';
<ToggleGroup type="single" defaultValue="center">
  <ToggleGroupItem value="left" aria-label="Align left">
    Left
  </ToggleGroupItem>
  <ToggleGroupItem value="center" aria-label="Align center">
    Center
  </ToggleGroupItem>
  <ToggleGroupItem value="right" aria-label="Align right">
    Right
  </ToggleGroupItem>
</ToggleGroup>

Overview

Built on Base UI's ToggleGroup and Toggle primitives, this component provides a set of related toggle buttons. Items display a pressed state via data-[pressed] styling, and the group handles single or multiple selection logic.

API Reference

ToggleGroup

Wraps Base UI's ToggleGroup. Accepts all props from the underlying primitive.

PropTypeDefaultDescription
type"single" | "multiple"Whether one or multiple items can be pressed.
valuestring | string[]Controlled pressed value(s).
defaultValuestring | string[]Initial pressed value(s) when uncontrolled.
classNamestringAdditional CSS class names.

ToggleGroupItem

Wraps Base UI's Toggle. Each item represents a pressable option within the group.

PropTypeDescription
valuestringUnique value identifying this toggle item.
disabledbooleanDisables this toggle item.
classNamestringAdditional CSS class names.
Edit on GitHub

On this page