ThiloDesign System
DV

Toggle Group

shadcn/ui
2 types

Set of toggle buttons — single or multiple selection. For segmented controls and formatting toolbars.

@/components/ui/toggle-group

Types

typePreviewBehavior
single
Only one item active at a time — selecting another deactivates the current
multiple
Any number of items can be active simultaneously

Variants

default

outline

disabled

Sizes

lg
default
sm

In context — density picker + formatting

Table density
Active: "default"— type="single", controlled with value + onValueChange
Active: ["bold"]— type="multiple"

Props — ToggleGroup

PropTypeDescription
type"single" | "multiple"Single: one active at a time. Multiple: any number active.
valuestring | string[]Controlled active item(s)
defaultValuestring | string[]Initially active item(s), uncontrolled
onValueChangefunction(value) => void
variant"default" | "outline"Passed to all items; outline adds border
size"sm" | "default" | "lg"Passed to all items
disabledbooleanDisables all items

ToggleGroupItem inherits variant/size from ToggleGroup. Active item: bg-accent text-accent-foreground

On this page