Skip to content
THE COMPONENT LIBRARY
Skip to content

Component reference

ButtonGroup

Related formatting actions in a compact editor toolbar.

Preview

Live preview

Changes apply to this preview only.

Design tokens

Draft · edited 2 minutes ago

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.

Attached

The default: adjacent buttons share their borders and only the outer corners stay rounded.

Open preview

Separators

A separator marks a boundary between action families without breaking the attached layout.

Open preview

Orientation

Vertical groups stack full-width buttons; the separator becomes a horizontal rule.

Open preview

Usage

Group actions that share a task; let individual buttons own activation and disabled states.

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.

PimoluButtonGroupProps

Type source
PimoluButtonGroupProps public API
NameTypeDefaultDescription
childrenReactNode—The buttons, separators and optional wrappers to group.
orientationPimoluButtonGroupOrientation | undefined"horizontal"Layout direction. Defaults to "horizontal".
attachedboolean | undefinedtrueCollapse adjacent borders and remove the inner radii so the buttons read as one control. Defaults to true.
defaultValuestring | number | readonly string[] | undefined—Standard React/HTML attribute.
classNamestring | undefined—Standard React/HTML attribute.
styleCSSProperties | undefined—Standard React/HTML attribute.
aria-labelstring | undefined—Defines a string value that labels the current element.
onChangeChangeEventHandler<HTMLDivElement, Element> | undefined—Standard React/HTML attribute.
onClickMouseEventHandler<HTMLDivElement> | undefined—Standard React/HTML attribute.
children

ReactNode

No default extracted.

The buttons, separators and optional wrappers to group.

orientation

PimoluButtonGroupOrientation | undefined

Default: "horizontal"

Layout direction. Defaults to "horizontal".

attached

boolean | undefined

Default: true

Collapse adjacent borders and remove the inner radii so the buttons read as one control. Defaults to true.

defaultValue

string | number | readonly string[] | undefined

No default extracted.

Standard React/HTML attribute.

className

string | undefined

No default extracted.

Standard React/HTML attribute.

style

CSSProperties | undefined

No default extracted.

Standard React/HTML attribute.

aria-label

string | undefined

No default extracted.

Defines a string value that labels the current element.

onChange

ChangeEventHandler<HTMLDivElement, Element> | undefined

No default extracted.

Standard React/HTML attribute.

onClick

MouseEventHandler<HTMLDivElement> | undefined

No default extracted.

Standard React/HTML attribute.

PimoluButtonGroupSeparatorProps

Type source
PimoluButtonGroupSeparatorProps public API
NameTypeDefaultDescription
orientationPimoluButtonGroupOrientation | undefined"horizontal"Line direction of the separator itself. When omitted it is derived from the parent group: a horizontal group gets a vertical rule and vice versa.
defaultValuestring | number | readonly string[] | undefined—Standard React/HTML attribute.
classNamestring | undefined—Standard React/HTML attribute.
styleCSSProperties | undefined—Standard React/HTML attribute.
aria-labelstring | undefined—Defines a string value that labels the current element.
childrenReactNode—Standard React/HTML attribute.
onChangeChangeEventHandler<HTMLSpanElement, Element> | undefined—Standard React/HTML attribute.
onClickMouseEventHandler<HTMLSpanElement> | undefined—Standard React/HTML attribute.
orientation

PimoluButtonGroupOrientation | undefined

Default: "horizontal"

Line direction of the separator itself. When omitted it is derived from the parent group: a horizontal group gets a vertical rule and vice versa.

defaultValue

string | number | readonly string[] | undefined

No default extracted.

Standard React/HTML attribute.

className

string | undefined

No default extracted.

Standard React/HTML attribute.

style

CSSProperties | undefined

No default extracted.

Standard React/HTML attribute.

aria-label

string | undefined

No default extracted.

Defines a string value that labels the current element.

children

ReactNode

No default extracted.

Standard React/HTML attribute.

onChange

ChangeEventHandler<HTMLSpanElement, Element> | undefined

No default extracted.

Standard React/HTML attribute.

onClick

MouseEventHandler<HTMLSpanElement> | undefined

No default extracted.

Standard React/HTML attribute.

Accessibility

  • Give icon actions names and do not use visual grouping as the only explanation.
Read the accessibility guide →