Button Group
Join buttons into a single visual unit for toolbars, steppers, split buttons and search affordances.
import { ButtonGroup, ButtonGroupSeparator, ButtonGroupText } from "@plexui/vue/components/ButtonGroup";Wraps any row of controls (Button, Input, a popover trigger, ...) and removes the shared border so they read as one unit. Nest ButtonGroup inside itself to create visually separated sub-groups (the outer group automatically spaces them).
On a phone with touch.css a group of buttons in a Toolbar is the Button Group of iOS: one glass capsule holding its buttons, the same as ToolbarGroup. mobile-material="glass" asks for the capsule outside a toolbar, for controls that float over the content. iOS has no joined buttons in the content, so a group there keeps its joined look at the touch sizes, and the examples that only join buttons show the desktop view.
Examples
Overview
Weekend trip
Pack the tent, two sleeping bags and the small stove.
Check the forecast on Friday morning before leaving.
Fill both water bottles and the spare canister.
Leave the route and the return time with a neighbour.
Orientation
Size
Nested
Separator
Split
Input
Input group
Dropdown menu
Select
Popover
API
ButtonGroup
| Prop | Type | Default | Description |
|---|---|---|---|
orientation | "horizontal" | "vertical" | "horizontal" | Direction of the joined items |
mobile-material | "glass" | "flat" | Phone surface with touch.css: "glass" makes the group one glass capsule outside a Toolbar, "flat" keeps the joined buttons in one | |
class | string | Applied to the root <div> |
Renders a <div role="group">. All other attributes and listeners fall through to it.
ButtonGroupSeparator
Inherits from Separator. orientation defaults to "vertical" (the axis that looks right between horizontal items); pass an explicit value inside a ButtonGroup orientation="vertical".
ButtonGroupText
Renders a muted label pill that slots into the group alongside buttons. Use it for prefixes ("@", "https://"), currency hints, or any non-interactive label that should share the joined shape.
| Prop | Type | Default | Description |
|---|---|---|---|
as-child | boolean | false | Render the slotted child (e.g. a <label> tied to an input) instead of a <div> |
class | string | Applied to the wrapper |
Styling
Nesting ButtonGroup inside a parent ButtonGroup automatically introduces a gap between the sub-groups. The group-specific tokens:
--button-group-nested-gap: space between sibling sub-groups (defaults tospacing(2)= 8px)--button-group-separator-color: color of theButtonGroupSeparatorline--button-group-text-background/--button-group-text-color/--button-group-text-border-color: surface, text, and 1px inset border ofButtonGroupText--button-group-text-font-size/--button-group-text-font-weight: typography ofButtonGroupText--button-group-glass-item-size,--button-group-glass-gap,--button-group-glass-padding: a glass group on a phone, its buttons, the space between them and at the ends (default44px,12px,2px; in aToolbarthe bar's own)--button-group-glass-vertical-item-size,--button-group-glass-vertical-gap,--button-group-glass-vertical-padding: a vertical glass group (default48px,6px,4px)--button-group-glass-nested-gap,--button-group-glass-label-gutter: between glass groups side by side, and the gutter of a label in one (default10px,14px)
Radius, border, and focus styles of joined buttons come from each child control's own tokens (--button-radius, --input-radius, etc.); the group only strips the shared edge radii so joined items align.