Toggle Group

Composable toolbar toggles: a standalone aria-pressed Toggle plus a shadcn-shaped ToggleGroup of ToggleGroupItem children in single or multiple mode, with default/outline variants, sm/md/lg sizes, one roving tab stop with arrow/Home/End keys, a pressed surface that glides between items in single mode and pops per item in multiple mode — the composable, icon-first counterpart to SegmentedControl's radiogroup.

Preview

Toggle Group preview width

Install

Add it with the shadcn CLI, or copy the source manually.

$ bunx --bun shadcn add @karaui/toggle-group
@karaui not found? Add it to components.json
{
  "registries": {
    "@karaui": "https://karaui.kamisama-v0.my.id/r/{name}.json"
  }
}

@karaui is in shadcn's public registry directory, so the latest CLI needs no setup. On an older CLI, merge this into the existing file once and every @karaui/… install resolves.

API Reference

ToggleGroup

className?
string
—

Toggle

className?
string
—
variant?
"outline" | "default"
default
size?
"sm" | "md" | "lg"
md
pressed?
boolean
—
defaultPressed?
boolean
false
onPressedChange?
((pressed: boolean) => void)
—

ToggleGroupItem

value
string
—
className?
string
—

Updated