---
title: Toggle Group
description: A set of two-state buttons that can be toggled on (pressed) or off (not pressed).
link:
  doc: https://kobalte.dev/docs/core/components/toggle-group
  api: https://kobalte.dev/docs/core/components/toggle-group#api-reference
---

<ComponentPreview name="toggle-group-demo">

```tsx file=<rootDir>/apps/docs/src/registry/examples/toggle-group-demo.tsx

```

</ComponentPreview>

## Installation

<ComponentInstallation>

<Step>

<StepItem>Copy and paste the following code into your project:</StepItem>

  <ComponentSourceTabs>

    ```tsx title="components/ui/toggle-group" file=<rootDir>/apps/docs/src/registry/ui/toggle-group.tsx

    ```

    ```tsx title="components/ui/toggle-group" file=<rootDir>/apps/unocss-playground/src/registry/ui/toggle-group.tsx

    ```

  </ComponentSourceTabs>

</Step>

</ComponentInstallation>

## Usage

```tsx
import { ToggleGroup, ToggleGroupItem } from "@components/ui/toggle-group"
```

```tsx
<ToggleGroup>
  <ToggleGroupItem />
</ToggleGroup>
```
