Skip to content

Toggle Group

Provides a shared state to a series of toggle buttons.

Installation

pnpm dlx shadcn@latest add @frontal-labs/toggle-group

Usage

import { ToggleGroup, ToggleGroupItem } from "@/components/ui/toggle-group";
<ToggleGroup>
  <ToggleGroupItem>Bold</ToggleGroupItem>
  <ToggleGroupItem>Italic</ToggleGroupItem>
  <ToggleGroupItem>Underline</ToggleGroupItem>
</ToggleGroup>

API Reference

ToggleGroup

Root component. Styled wrapper for ToggleGroup.Root from Base UI. Provides shared variant and size to child toggles via context.

ToggleGroupItem

Individual toggle button within the group. Styled wrapper for Toggle from Base UI. Inherits variant and size from parent ToggleGroup context.

ToggleGroupSeparator

Visual separator between toggle buttons.

Examples

Small Toggles

Large Toggles

With Outline Toggles

Component p-toggle-group-4 not found in registry.

Vertical

Component p-toggle-group-5 not found in registry.

Disabled

With Disabled Toggle

Multiple selection

With Tooltips

Changelog