Toggle group
toggle-groupA row of toggles that share a value, or several. One control rather than a row of separate buttons: the selected one is filled and its neighbours stay quiet, and it works for icon-only formatting bars and for labelled density switches alike.
import { Bold, Italic, Underline } from "lucide-react";
import { Toggle, ToggleGroup } from "@/components/forme/toggle-group/toggle-group";
export function ToggleGroupDemo() {
return (
<div className="flex flex-col gap-6">
<ToggleGroup defaultValue={["bold"]} aria-label="Text formatting">
<Toggle value="bold" aria-label="Bold">
<Bold aria-hidden className="size-4" />
</Toggle>
<Toggle value="italic" aria-label="Italic">
<Italic aria-hidden className="size-4" />
</Toggle>
<Toggle value="underline" aria-label="Underline">
<Underline aria-hidden className="size-4" />
</Toggle>
</ToggleGroup>
<ToggleGroup defaultValue={["compact"]} aria-label="Density">
<Toggle value="cozy">Cozy</Toggle>
<Toggle value="compact">Compact</Toggle>
<Toggle value="dense">Dense</Toggle>
</ToggleGroup>
</div>
);
}Install
Adds the component, its registry dependencies, and the token stylesheet you import once.
API reference
Read from the source, so it is the API of the file you install. A prop marked * is required.
ToggleGroup
A group of toggles that share a value, or several.
| Prop | Type | Default | Description |
|---|---|---|---|
toggle | "default" | "outline" | — |
Also takes every prop of ComponentProps<typeof ToggleGroupPrimitive>.
Toggle
| Prop | Type | Default | Description |
|---|---|---|---|
destructive | boolean | — | Render destructive: for a toggle that turns something off on purpose. |
Also takes every prop of ComponentProps<typeof TogglePrimitive>.
Related


Multi Select
Choose several options from a long list: removable chips you can type into to filter, over a list where each option toggles. Groups, a max with a counter, Backspace and arrow keys through the chips, and plain form submission — on Base UI's Combobox.
inputs

Calendar
A month grid for a single date or a range, with no date library. Full WAI-ARIA keyboard support, min, max and disabled days, a range that previews under the pointer, and a fixed six-week height so nothing below it jumps.
inputs

File Dropzone
A drop target that is also a real file picker, so click, keyboard and drag all work. Checks type and size on drop as well as in the picker, and reports each rejected file by name.
inputs