Installation
npx shadcn@latest add @iconiq/r-togglegroupProps
ToggleGroupItem
5 props
Each toggle is described by a plain object so both provider-backed installs keep the same display and selection contract.
value
stringRequired
Stable identifier used for selection state and forwarded to the underlying toggle primitive item.
label
ReactNodeRequired
Visible item content rendered inside each segmented button. This can be plain text or richer inline content.
icon
ReactNodeOptional leading visual rendered before the label inside the button surface.
disabled
booleanDisables that item while keeping the rest of the group interactive.
ariaLabel
stringAccessible item name for icon-only buttons or abbreviated visual labels.
ToggleGroup
13 props
Segmented toggle group with the same Iconiq API layered over Radix UI primitives.
items
ToggleGroupItem[]Required
Buttons to render in display order.
type
"single" | "multiple"Default
"multiple"Defaults to multiple selection. Pass type="single" for a one-of-many picker.
value
string | string[]Controlled selection state. Use a string for single mode or an array for multiple mode.
defaultValue
string | string[]Initial selection state for uncontrolled usage, following the same single versus multiple shape as value.
onValueChange
((value: string | undefined) => void) | ((value: string[]) => void)Called with the next selected value in single mode or the next ordered selected values array in multiple mode.
size
"default" | "sm"Default
"default"Adjusts the item height, minimum width, and label sizing while keeping the same motion profile.
orientation
"horizontal" | "vertical"Default
"horizontal"Changes both the visual layout and the underlying keyboard navigation axis.
disabled
booleanDisables the whole group and prevents hover, tap, and selection changes.
className
stringMerged onto the segmented group shell for width, spacing, or placement overrides.
itemClassName
stringMerged onto every toggle item so you can tune button sizing or local visual treatment without rewriting the structure.
reducedMotion
booleanForces the quieter motion path while still respecting OS-level reduced motion preferences.
aria-label
stringAccessible name for the group when no external label element is connected.
aria-labelledby
stringReferences external text that labels the whole group, which takes precedence over aria-label.
Notes
Current install target: Radix UI.
Dependencies declared by this registry entry: @radix-ui/react-toggle-group, motion.
Multiple mode is the default and starts with no items selected unless you pass defaultValue or a controlled value array.
Multiple mode normalizes outgoing values back into the original item order, so the callback shape stays stable even if users toggle items out of sequence.
Pass type="single" when only one item should stay pressed at a time. Single mode starts with no implicit selection unless you provide value or defaultValue.
Icon-only items should provide ariaLabel so every button still has a clear accessible name.
Installs a Radix UI toggle group with the same items, type, value, defaultValue, size, orientation, and reducedMotion API as the Base UI version.
Uses Radix toggle-group semantics underneath the same accent-fill toolbar styling as the Base UI version.