Intro
A segmented button is a group of connected buttons that users can select. The group appears as a single component divided into multiple segments.
Segmented button
Component availability
This component is available in the following libraries:
When to Use
Use the segmented button to:
- Let users choose from a small set of related options, such as “Year, Month, Day” or “Small, Medium, Large”.
Don’t use the segmented button to:
- Display a large number of options. Use a split menu button or radio button group instead.
- Use single selection mode when users should be able to select only one segment at a time.
- Use multiple selection mode when users should be able to select any combination of segments (SAP Web Components only).
- Start with no selection when appropriate.
- For icon-only segmented buttons, add a tooltip to each segment with a clear label.
Anatomy
The segmented button component consists of the following elements:
- Background: Different background colors visualize the state of the segmented button and indicate the interactive areas (segments).
- Text or icon: Describes the action associated with each segment.
Anatomy of a segmented button
Types
Display types
The segmented button supports three display types:
A: Text only
B: Icon only
C: Text and icon
Display types
Selection modes
There are two types of selection mode: single selection and multiple selection (SAP Web Components only).
A: Single selection: When the user clicks a segment, it becomes selected. All other segments are deselected. Only one segment is selected at a time.
B: Multiple selection :badge, info, medium, _, SAP Web Components: : When the user clicks a segment, it toggles between selected and unselected, without affecting the other segments. In multiple selection mode, the user can select any combination of buttons.
Selection modes
Note: The segmented button can be configured to start with no segments selected.
States
Component states
The segments of the segmented button each have one of two states: enabled or disabled.
A: Enabled: In this state, the segment is interactive, enabling the user to select it and trigger its associated action.
B: Disabled: In this state, the segment is not interactive and cannot be selected or triggered by the user.
The segmented button can simultaneously contain both enabled and disabled segments.
Component states: enabled (A) and disabled (B)
For more information, see Component States.
Interaction states
Segmented buttons feature three interaction states – regular, hover, and down – each of which is paired with either an unselected or selected state.
Regular states
A: Regular unselected is the default, unselected state for a segment.
B: Regular selected is the state when the segment is selected.
Regular states: unselected (A) and selected (B)
Hover states
A: Hover unselected is the state when the cursor of a pointing device (such as a mouse or pen) is currently placed on an unselected segment that is in an enabled state.
B: Hover selected is the state when the cursor of a pointing device (such as a mouse or pen) is currently placed on a selected segment that is in an enabled state.
Hover states: unselected (A) and selected (B)
Down state
Down unselected state
For more information, see Interaction States.
Focus state
The focus state determines which component receives input from the keyboard or another input device. Keyboard and assistive technology users rely on the focus state to follow the interaction.
The focus state is visualized by an additional border around the segment.
When interaction begins, focus is set on the active segment.
Focused unselected (A) and focused selected (B) states
For more information, see Focus States.
Behavior and Interaction
Mouse interaction
Single selection
On mouse down, the segment becomes active and receives focus.
A: The user starts pressing an unselected segment.
B: When the user releases while still on the segment, the segment is selected, its action is triggered, and the previously selected segment is deselected.
Single selection interactions
Multiple selection :badge, info, large, _, SAP Web Components only:
A: The user starts pressing an unselected segment.
B: When the user releases while still on the segment, the segment is selected, its action is triggered, and the other segments remain unchanged.
Multiple selection interactions
Selection cancellation
If the user releases the mouse button outside the pressed segment, all segments remain in their current interaction state, and no action is triggered. This applies to both single selection and multiple selection.
Focus appears without any action being triggered
Touch interaction
On touch devices, the behavior is similar to the mouse interaction, without the hover and focus states.
Tooltips
When designing icon-only segmented buttons, always pair them with a tooltip that labels each icon-only segment.
Segmented button with tooltip – icon only
For more information, see Using Tooltips.
Responsiveness
By default, all segments share the same width, based on the longest text label. Alternatively, the component can be configured so that each individual segment adapts to the width of its text or icon.
Segmented button with different text lengths – default width and content fit
The segmented button supports cozy and compact content densities.
Compact (A) and cozy (B) content densities
Accessibility
SAP follows international standards, such as WCAG and WAI-ARIA, and strives to make our business solutions accessible and inclusive.
For more information, see Accessibility in SAP Fiori and the Accessibility Design Tools Handbook.
Keyboard navigation
The following key combinations are supported by the segmented button component.
Screen reader support
For additional details on screen reader support and Accessible Rich Internet Applications (ARIA), see UI5 Screen Reader Support and WAI-ARIA Authoring.
Content
Localization
The segmented button supports left-to-right (LTR) and right-to-left (RTL) reading directions.
Segmented button – left-to-right
Segmented button – right-to-left
Framework Comparison
The table below summarizes the differences between SAPUI5 and SAP Web Components and lists the framework-specific patterns.
[internal_only]To request this feature for SAP Web Components, please submit an InnerSource request.[/internal_only]
Related Links
Guidelines
Components
Button
Implementation
SAPUI5
Segmented Button (samples)
Segmented Button (API reference)
UI5 Web Components
Segmented Button
Guidelines
Components
Button
Implementation
SAPUI5
Segmented button (samples)
Segmented Button (API reference)
UI5 Web Components
Segmented Button
UI Kit (Figma)
SAP Fiori for Web UI Kit / Segmented Button