React playground

Nova v3.37.0

Preview

React

Button group

nv-buttongroup

Groups related actions so they share one size and emphasis and read as a single control.

Live demo

Emphasis
Size
Orientation

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.

A button group with buttons and an icon button.
  1. Button with a label and optional leading or trailing icon.
  2. 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.

high
medium · default
low
lower
horizontal · default
vertical

Guidelines

  • Keep a group to a few related actions with short labels.
  • Name the group for assistive technology with role="group" and an aria-label.
  • Follow the Button guidance for labels and emphasis.
DoJoin a few related actions with short labels.
Don'tAvoid mixing unrelated actions or long labels in one group.

Sources