Live demo
Demo source
Use a button group to join a few closely related actions, such as export formats or zoom controls. To let people choose one or more options, use a toggle button group instead: a button group does not manage selection.
Anatomy
A joined group of three orange buttons: Daily, Monthly and a chevron. Callout 1 marks the Daily button, callout 2 the chevron icon button.
- Button with a label and optional leading or trailing icon.
- Icon button for an icon-only action when space is tight. Give it an accessible label.
States
Each child button has default, hover, focus, pressed and disabled states. Set
disabled on an unavailable child; the group has no group-wide disabled
prop. Keep keyboard focus visible in production as well as during
development. A pressed or active appearance does not make this group manage
selection; use a toggle button group for that behaviour.
Emphasis and size
The group's emphasis (medium by default) and size apply to every button
inside it, so set them on the group rather than on its buttons. A menu or
popover can sit inside the group; its trigger button joins the group.
orientation="vertical" stacks the buttons.
Choose high, medium, low or lower emphasis, and xs, sm, md
(default) or lg size. Match size to the surrounding controls and required
touch area. Both labelled and icon-only children share these settings.
Guidelines
- Keep a group to a few related actions with short labels.
- Name the group for assistive technology with
role="group"and anaria-label. - Follow the Button guidance for labels and emphasis.