Segmented button group

Figma logo The guideline content on this page is synced with Figma and can be used as a source of truth. Open in Figma

Segmented button group displays multiple related actions stacked or in a horizontal row to help with arrangement and spacing. The buttons are displayed as a horizontal group of buttons, where only one option can be selected at a time.


Anatomy

  1. Selected content tab
  2. Content tab
  3. Label text
  4. Container
Segmented button group anatomy diagram showing selected tab, content tab, label text, and container

With icon

An icon should be used in a segmented control when it provides quick, universal understanding of the option and can replace or supplement text for clarity and space efficiency.


States

This component has the following states:

  1. Default
  2. Hover
  3. Focus
  4. Selected
  5. Disabled

States


Usage

Information

When a user clicks an option, it becomes active, and the previously selected option becomes inactive. Segmented buttons are visually connected, typically contained within a single border or container.

The primary function is to enable users to switch between different views of the same content, sort data, or choose a single setting from a limited set of options.

The number of segments should be small, typically 2 to 5, to prevent the component from becoming too wide or overwhelming for the user.

The effect of selecting a button should be immediate and obvious, with no need for a “Submit” or “Apply” button.

Badge

You can display a number next to the text in the segmented button. This feature can be toggled on or off in the settings menu located in the top right corner of Figma.

Placement

Segmented button groups are positioned within the sub-header region, situated between the page title and the primary data container.

This placement establishes a definitive visual hierarchy, designating the component as a high-level view controller that governs the scope of the underlying content.

Segmented button group placement within sub-header region

Accessibility

Keyboard interaction

All components should be reachable via TAB and SHIFT+TAB keys.


Best practices

Short text

Do

Keep labels short and concise. If a label is too long for a segmented control, use a different component like a dropdown or quick filter.

Don't

Don’t use long labels.

Consistent size

Do

Keep button widths consistent across all segments.

Don't

Don’t change the width of individual buttons.


Specs

Segmented button group specifications showing dimensions and spacing

Developer reference

The following sections describe supported functionality that is not part of the Figma design specification.


Design

Default

Add .btn-group-tabs class to the .btn-group to create segmented controls. Use .active on the selected button and aria-selected="true" for accessibility.

Small size

Add .btn-group-tabs-sm class to the wrapper for a smaller variant.

Disabled

Add the disabled attribute to individual buttons to disable them.

Single disabled button

All disabled


Animated segmented control

Add the .btn-group-animation class to the .btn-group-tabs wrapper. The selected button is highlighted by a ::before pseudo-element on the wrapper, which slides between segments instead of the background moving with the button.

To move the indicator, read the selected button's border-box width and its offset from the .btn-group-animation wrapper's content edge, then pass both to the pseudo-element. You can either target ::before from your own stylesheet, or — as the demo below does — set two CSS custom properties on the wrapper: --btn-grp-animation-width for the selected button's width, and --btn-grp-animation-offset for its X-axis offset. Both default to 0, so the indicator stays invisible until your script sets them.

Default size

Combine .btn-group-tabs with .btn-group-animation for the 40 px variant.

Small size

Add .btn-group-tabs-sm as well for the 32 px variant. Use a layout utility such as .d-flex.flex-wrap.gap-8 to place two groups side by side — never a wrapping .btn-group, which would style them as one connected control.