Intro
The button is a UI component used to trigger actions. Different styles indicate the intent and importance of each action.
Button
Component availability
The button component is available in the following libraries:
The guideline covers the button component. For other button types, see the Buttons Overview.
When to Use
Use the button to:
- Offer a single action, such as: Create, Edit, Save, Delete, Approve, Reject, Add, Remove, Cancel.
Don’t use the button to:
- Switch between different states. Opt for a toggle button or switch instead.
- Display a group of options. Choose a split button or segmented button instead.
- Use the button to offer a single action, such as Create, Edit, Save.
- Use emphasized buttons for primary actions, standard buttons for secondary actions, and transparent buttons for tertiary actions.
- Apply button text and icon buttons guidelines to ensure actions are clear.
- Always provide a tooltip for icon-only buttons to clarify the action.
- Always provide a tooltip when button text is truncated to display the full label.
- Use only one badge per button. Do not combine counter and attention badges.
- Place the counter badge inside the button in compact mode and in the top right corner in cozy mode.
Anatomy
The button component consists of two elements:
- Background: Different background colors indicate the button state.
- Text, icon, or both: Describe the triggered action.
Button anatomy
Types
Display types
The button supports three display types:
A: Text only
B: Icon only
C: Text and icon
Display types
- Always use text buttons for primary, secondary, semantic, and negative path actions.
- Within SAP S/4HANA, a button can contain either an icon or a text.
- The SAP Fiori Elements framework supports only text buttons, except for in tables, where inline action buttons can be either icon or text, not both.
Hierarchy types
Emphasized
The emphasized button appears with a blue background and white text and icons. Use for primary actions.
Emphasized type
Standard
The standard button appears with a white background and subtle gray border. Use for secondary actions.
Standard type
Transparent
The transparent button appears with a transparent background and no border. Use for tertiary actions.
Transparent type
For more information on different action types, see the Action Placement guideline.
States
Component states
The button has two component states: enabled and disabled.
B: Disabled: The button is not interactive and cannot be selected or triggered by the user.
Component states
Interaction states
The button has three interaction states: regular, hover, and down.
Regular state
Hover state
Down state
For more information, see Interaction States.
Focus state
The focus state indicates which element is currently active, helping keyboard and assistive technology users follow the interaction.
Focus state
For more information, see Focus States.
Value states
The button supports value states that indicate status. Each state uses a distinct color.
Negative state
Critical state
Positive state
For more information, see Value States.
Behavior and Interaction
Mouse interaction
A: Displays the default state of the button.
B: Hovering applies the hover state.
C: Pressing the button applies the down and focus states.
D: Releasing the button triggers the action. The button returns to hover while focus remains.
E: Moving the cursor away returns the button to the default state while focus remains.
Standard button interaction
Emphasized button interaction
Touch interaction
On touch devices, interaction is similar but without hover. Focus behavior remains the same.
For more information, see Gestures.
Tooltip
Always provide a tooltip for icon-only buttons to clarify the action.
Icon-only button with tooltip
Provide a tooltip when button text is truncated to display the full label.
Text button with tooltip for truncated text
For more information, see Using Tooltips.
Responsiveness
By default, the button expands and shrinks with the width of the text or icon.
Button with different lengths
If the button has a fixed width, its text can truncate if it’s too long to fit.
Button with fixed width and different text lengths
The button supports compact and cozy content densities.
Compact (A) and cozy (B) content densities
For more information, see Content Density.
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 SAPUI5 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
Button Text
- Choose a button text that is short and meaningful. Check out the UI text guidelines for more information.
- Always use text-only buttons for business actions.[internal_only] For more information, see the UX consistency standard for action placement (UXC-014).[/internal_only]
- Use a verb in the imperative for all actions (for example: Save, Cancel, Edit).
Note: The grammatical form for actions can differ for other languages. For example, German action labels use the infinitive (Sichern, Abbrechen, Bearbeiten).[internal_only] - For common actions, use the standard action labels defined in the UX consistency product standard for terminology (UXC-015).[/internal_only]
- Keep in mind that the text can be up to 300% longer in other languages.[internal_only] For more information on UI text length in other languages, see the UI text space calculator.[/internal_only]
- If you need to show the number of items that will be affected by the action of the button, you can add the number in parentheses. For example, Edit (3).
Icon Buttons
- [internal_only]Only use icon buttons for generic actions. When using icon buttons, limit them to very basic standard icon metaphors described in the product standard for UX consistency (UXC-019 – Iconography, section: "Specification Icon Metaphor Alignment"). For more information about icons in general, check out the article on iconography.[/internal_only][external_only]Use icon buttons only if the icon metaphor is easily recognizable. Ideally, it should have the same meaning worldwide.[/external_only]
- Make sure the default accessibility text for the icon is correct for your use case.[internal_only] By default, the technical icon name from the SAP icon font is used.[/internal_only] If the text is not ideal, define an app-specific accessibility text.
- Offer a tooltip to show the label for icon buttons.
- Don’t use the icon control for buttons. Use the icon property for the button instead.
Localization
The button supports left-to-right (LTR) and right-to-left (RTL) reading directions.
Button – left-to-right
Button – right-to-left
Features
Badge
The button supports badges to highlight information. There are two badge types: counter badge and attention badge.
Counter badge: Displays a number. For example, it displays the number of items in a shopping cart.
Emphasized, standard, and transparent buttons with counter badge
Attention badge: Highlights the button to draw user's attention. For example, it indicates that a new comment is available.
Emphasized, standard, and transparent buttons with attention badge
A button can have only one badge at a time. Avoid combining counter and attention badges.
Depending on whether the button is in compact or cozy form factor, the counter badge is placed differently. If the button is in compact form factor, the counter badge is placed inside the button. If the button is in cozy form factor, the counter badge is placed in the top right corner.
Counter badge in button with compact (above) and cozy (below) form factor
Buttons with value states can also have counter or attention badges.
Counter and attention badges in buttons with different value states
The focus of the button appears differently depending on the type of badge.
For counter badges, the focus border appears around the badge, while for attention badges, it appears beneath the badge.
Counter and attention badges in buttons with focus
Framework Comparison
There are no differences between SAPUI5 and SAP Web Components regarding thе component's behaviors and framework-specific patterns.
Related Links
Guidelines
Components
Action Placement
Menu Button
Toggle Button
Segmented Button
Guidelines
Components
Action Placement
Menu Button
Toggle Button
Segmented Button
UI Kit (Figma)
SAP Fiori for Web UI Kit / Button