information
icon
This guideline now covers both SAPUI5 and SAP Web Components.
manual
Learn more.

Intro

The button is a UI component used to trigger actions. Different styles indicate the intent and importance of each action.

Four buttons showing emphasized and standard text buttons followed by emphasized and standard icon-only buttons.

Button

Component availability

The button component is available in the following libraries:

<div> <div data-valign="middle">Library</div> <div data-valign="middle">Technical Name</div> <div data-valign="middle">Identifier</div> </div> <div> <div data-valign="middle">SAPUI5 Demo Kit</div> <div><a href="https%3A%2F%2Fui5.sap.com%2F%23%2Fentity%2Fsap.m.Button">sap.m.Button</a></div> <div data-valign="middle">:badge, info, large, _, SAPUI5:</div> </div> <div> <div data-valign="middle">SAP Web Components</div> <div data-valign="middle"><a href="https://ui5.github.io/webcomponents/components/Button/">ui5-button</a></div> <div data-valign="middle">:badge, info, large, _, SAP Web Components:</div> </div> <div> <div data-valign="middle">SAP Web UI Kit (Figma)</div> <div data-valign="middle"><a href="https%3A%2F%2Fwww.figma.com%2Fdesign%2FSILcWzK5uFghKun9jx6D7c%2FSAP-Web-UI-Kit%3Fnode-id%3D405763-7631%26t%3DGJp0oL04tYK2eIQ5-4">Button</a></div> <div data-valign="middle">:badge, info, large, _, Figma:</div> </div>
<div> <div data-valign="middle">Library</div> <div data-valign="middle">Technical Name</div> <div data-valign="middle">Identifier</div> </div> <div> <div data-valign="middle">SAPUI5 Demo Kit</div> <div><a href="https%3A%2F%2Fui5.sap.com%2F%23%2Fentity%2Fsap.m.Button">sap.m.Button</a></div> <div data-valign="middle">:badge, info, large, _, SAPUI5:</div> </div> <div> <div data-valign="middle">SAP Web Components</div> <div data-valign="middle"><a href="https://ui5.github.io/webcomponents/components/Button/">ui5-button</a></div> <div data-valign="middle">:badge, info, large, _, SAP Web Components:</div> </div> <div> <div data-valign="middle">SAP Fiori for Web UI Kit (Figma)</div> <div data-valign="middle"><a href="https%3A%2F%2Fwww.figma.com%2Fcommunity%2Ffile%2F1494295794601744471">Button</a></div> <div data-valign="middle">:badge, info, large, _, Figma:</div> </div>

The guideline covers the button component. For other button types, see the Buttons Overview.

When to Use

2
do
false

Use the button to:

  • Offer a single action, such as: Create, Edit, Save, Delete, Approve, Reject, Add, Remove, Cancel.
dont
false

Don’t use the button to:

toptip
  • 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:

  1. Background: Different background colors indicate the button state.
  2. Text, icon, or both: Describe the triggered action.

Button anatomy with two labeled elements: background (1) and text (2).

Button anatomy

Types

Display types

The button supports three display types:

A: Text only
B: Icon only
C: Text and icon

Three button display types: A – text only, B – icon only, C – text and icon combined.

Display types

guideline
  • 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.

Three emphasized buttons with blue background in text-only, icon-only, and text-and-icon variants.

Emphasized type

Standard

The standard button appears with a white background and subtle gray border. Use for secondary actions.

Three standard buttons with white background and gray border in text-only, icon-only, and text-and-icon variants.

Standard type

Transparent

The transparent button appears with a transparent background and no border. Use for tertiary actions.

Three transparent buttons with no background or border in text-only, icon-only, and text-and-icon variants.

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.

A: Enabled: The button is interactive, enabling the user to select it and trigger its associated action.
B: Disabled: The button is not interactive and cannot be selected or triggered by the user.

Two button component states: A – enabled (active and interactive) and B – disabled (non-interactive), shown across emphasized, standard, and transparent buttons.

Component states

For more information, see Component states.

Interaction states

The button has three interaction states: regular, hover, and down.

Regular: Displays the default state for the button.

Regular (default) state shown for emphasized, standard, and transparent button types.

Regular state

Hover: Displays the hover state when the cursor is over an enabled button.

Hover state shown for emphasized, standard, and transparent button types when the cursor is positioned over an enabled button.

Hover state

Down: Displays the state when currently pressing a button.

Down state shown for emphasized, standard, and transparent button types while the button is being pressed.

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 is visualized by an additional border inside the button.

Focus state shown for emphasized, standard, and transparent buttons, indicated by an additional border inside the button.

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: Indicates an error or issue that requires resolution.

Negative value state shown on text-only and text-with-icon buttons labeled "Reject", indicating an error requiring attention.

Negative state

Critical: Signals a warning or something that needs caution or a follow-up action.

Critical value state shown on text-only and text-with-icon buttons labeled "Attention", signaling a warning or caution.

Critical state

Positive: Shows success or confirmation that an action has been completed.

Positive value state shown on text-only and text-with-icon buttons labeled "Attention", confirming a successful action.

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 mouse interaction sequence: A – default, B – hover, C – pressed with focus, D – released returning to hover, E – cursor moved away.

Standard button interaction

Emphasized button mouse interaction sequence: A – default, B – hover, C – pressed with focus, D – released returning to hover, E – cursor moved away.

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 displaying a "Settings" tooltip on hover.

Icon-only button with tooltip

Provide a tooltip when button text is truncated to display the full label.

Text button with truncated label showing a tooltip with the full button text on hover.

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.

Three buttons of varying widths: icon-only, short text, and longer text with icon, showing how buttons expand to fit content.

Button with different lengths

If the button has a fixed width, its text can truncate if it’s too long to fit.

Three buttons at a fixed width: short text fits fully, medium text fits fully, and longer text is truncated with an ellipsis.

Button with fixed width and different text lengths

The button supports compact and cozy content densities.

Two button content densities: A – compact (smaller button with tighter padding) and B – cozy (larger button with more padding).

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.

<div> <div>Key Combination</div> <div>What it Does</div> </div> <div> <div><strong>Tab</strong></div> <div>Moves the focus to the button. If the focus is already there, the focus is moved to the next UI element.</div> </div> <div> <div><strong>Shift + Tab</strong></div> <div>Backward navigation.</div> </div> <div> <div><strong>Enter/Return</strong> or <strong>Spacebar</strong></div> <div>Triggers the action of the focused button.</div> </div> <div> <div><strong>Shift</strong> or <strong>Escape</strong></div> <div>If the Spacebar is pressed, the button is released without triggering its action.</div> </div>

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

Icon Buttons

Localization

The button supports left-to-right (LTR) and right-to-left (RTL) reading directions.

Button in left-to-right layout with an icon on the left followed by English text.

Button – left-to-right

Button in right-to-left layout with Arabic text on the left followed by an icon.

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.

Counter badges on emphasized, standard, and transparent button types, shown in both text and icon-only variants displaying a shopping cart icon and the number 72.

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.

Attention badges on emphasized, standard, and transparent button types, shown in both text and icon-only variants.

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 placement: inside the button in compact form factor (above), and in the top-right corner in cozy form factor (below).

Counter badge in button with compact (above) and cozy (below) form factor

Buttons with value states can also have counter or attention badges.

Counter badges (top row) and attention badges (bottom row) shown on buttons in negative, critical, and positive value states.

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.

Focus behavior for badges: focus border appears around the counter badge and beneath the attention badge, shown across emphasized, standard, and transparent types.

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.

Guidelines

Components
Action Placement
Menu Button
Toggle Button
Segmented Button

Implementation

SAPUI5
Button (samples)
Button (API reference)

UI5 Web Components
Button

Specifications

Button (visual design)

SAP Web UI Kit

Button (Figma)

Guidelines

Components
Action Placement
Menu Button
Toggle Button
Segmented Button

Implementation

SAPUI5
Button (samples)
Button (API reference)

UI5 Web Components
Button

UI Kit (Figma)

SAP Fiori for Web UI Kit / Button