For the complete documentation index, see llms.txt. Markdown variants are available by appending .md to any URL or sending an Accept: text/markdown header. An agent skill is available at /.well-known/agent-skills/site-skill.md.
0
Sponsor

Toggle Group

A set of two-state buttons that can be toggled on or off.

import { BoldIcon, ItalicIcon, UnderlineIcon } from "lucide-react";

import {
  ToggleGroup,
  ToggleGroupItem,
} from "@/components/toggle-group/toggle-group";

Installation

$ pnpm dlx shadcn@latest add https://shadcn-cssinjs.vercel.app/r/toggle-group.json

Usage

import {
  ToggleGroup,
  ToggleGroupItem,
} from "@/components/ui/toggle-group/toggle-group";
<ToggleGroup multiple>
  <ToggleGroupItem value="bold">B</ToggleGroupItem>
  <ToggleGroupItem value="italic">I</ToggleGroupItem>
</ToggleGroup>

Composition

Use the following composition to build a Toggle Group:

ToggleGroup
├── ToggleGroupItem
└── ToggleGroupItem

RTL

To enable right-to-left support, see the RTL guide.

"use client";

import { BoldIcon, ItalicIcon, UnderlineIcon } from "lucide-react";

import { useTranslation } from "@/components/language-selector";
import type { Translations } from "@/components/language-selector";

API Reference

See the Base UI documentation for the full API.