Skip to content
THE COMPONENT LIBRARY
Skip to content

Component reference

ToggleGroup

Choose several formatting options in one group.

Preview

Live preview

Changes apply to this preview only.

bold

Width adapts to the available space

More examples

Different configurations and compositions using the real Pimolu API. Each preview runs independently and follows the site appearance.

Single

type='single' with a controlled value; clicking the selected item keeps it selected.

Open preview

Variants and sizes

The group passes its variant and size to every item.

Open preview

Orientation and disabled

Vertical stacks the items; the group or a single item can be disabled.

Open preview

Usage

Use the multiple-selection model for independent choices and single selection for exclusive modes.

API reference

Generated from the public TypeScript declarations. Native HTML attributes are inherited where the component extends them; this reference includes Pimolu props and selected common native attributes.

PimoluToggleGroupProps

Type source
PimoluToggleGroupProps public API
NameTypeDefaultDescription
childrenRequiredReactNode—Public Pimolu prop; see the source declaration for details.
variant"outline" | "ghost" | "default" | undefined"default"Visual treatment shared by the items.
size"sm" | "md" | "lg" | undefined"md"Height and font size shared by the items.
orientationPimoluToggleGroupOrientation | undefined"horizontal"Layout of the items. Defaults to "horizontal".
disabledboolean | undefinedfalseDisable every item.
aria-labelstring | undefined—Accessible name of the group.
aria-labelledbystring | undefined—Id of the element that names the group.
classNamestring | undefined—Public Pimolu prop; see the source declaration for details.
type"single" | "multiple" | undefined—One selected value at a time. Any number of selected values.
valuestring | string[] | undefined—Public Pimolu prop; see the source declaration for details.
defaultValuestring | string[] | undefined—Public Pimolu prop; see the source declaration for details.
onValueChange((value: string) => void) | ((value: string[]) => void) | undefined—Public Pimolu prop; see the source declaration for details.
childrenRequired

ReactNode

No default extracted.

Public Pimolu prop; see the source declaration for details.

variant

"outline" | "ghost" | "default" | undefined

Default: "default"

Visual treatment shared by the items.

size

"sm" | "md" | "lg" | undefined

Default: "md"

Height and font size shared by the items.

orientation

PimoluToggleGroupOrientation | undefined

Default: "horizontal"

Layout of the items. Defaults to "horizontal".

disabled

boolean | undefined

Default: false

Disable every item.

aria-label

string | undefined

No default extracted.

Accessible name of the group.

aria-labelledby

string | undefined

No default extracted.

Id of the element that names the group.

className

string | undefined

No default extracted.

Public Pimolu prop; see the source declaration for details.

type

"single" | "multiple" | undefined

No default extracted.

One selected value at a time. Any number of selected values.

value

string | string[] | undefined

No default extracted.

Public Pimolu prop; see the source declaration for details.

defaultValue

string | string[] | undefined

No default extracted.

Public Pimolu prop; see the source declaration for details.

onValueChange

((value: string) => void) | ((value: string[]) => void) | undefined

No default extracted.

Public Pimolu prop; see the source declaration for details.

PimoluToggleGroupItemProps

Type source
PimoluToggleGroupItemProps public API
NameTypeDefaultDescription
valueRequiredstring—Value toggled by this item.
disabledboolean | undefinedfalsePublic Pimolu prop; see the source declaration for details.
childrenRequiredReactNode—Public Pimolu prop; see the source declaration for details.
classNamestring | undefined—Public Pimolu prop; see the source declaration for details.
valueRequired

string

No default extracted.

Value toggled by this item.

disabled

boolean | undefined

Default: false

Public Pimolu prop; see the source declaration for details.

childrenRequired

ReactNode

No default extracted.

Public Pimolu prop; see the source declaration for details.

className

string | undefined

No default extracted.

Public Pimolu prop; see the source declaration for details.

Accessibility

  • Name the group and verify arrow navigation without relying on color for selection.
Read the accessibility guide →