Skip to main content

SplitButton

ui5-split-button enables users to trigger actions. It is constructed of two separate actions - default action and arrow action that can be activated by clicking or tapping, or by pressing certain keyboard keys - Space or Enter for default action, and Arrow Down or Arrow Up for arrow action.

Usage​

ui5-split-button consists two separate buttons:

  • for the first one (default action) you can define some text or an icon, or both. Also, it is possible to define different icon for active state of this button - activeIcon.
  • the second one (arrow action) contains only slim-arrow-down icon.

You can choose a design from a set of predefined types (the same as for ui5-button) that offer different styling to correspond to the triggered action. Both text and arrow actions have the same design.

You can set the ui5-split-button as enabled or disabled. Both parts of an enabled ui5-split-button can be pressed by clicking or tapping it, or by certain keys, which changes the style to provide visual feedback to the user that it is pressed or hovered over with the mouse cursor. A disabled ui5-split-button appears inactive and any of the two buttons cannot be pressed.

Keyboard Handling​

  • Space or Enter - triggers the default action

  • Shift or Escape - if Space is pressed, releases the default action button without triggering the click event.

  • Arrow Down, Arrow Up, Alt+Arrow Down, Alt+Arrow Up, or F4 - triggers the arrow action There are separate events that are fired on activating of ui5-split-button parts:

  • click for the first button (default action)

  • arrow-click for the second button (arrow action)

ES6 Module Import​

import "@ui5/webcomponents/dist/SplitButton.js";

Basic Sample​

Properties​

icon​

DescriptionDefines the icon to be displayed as graphical element within the component. The SAP-icons font provides numerous options.
Example:
See all the available icons in the Icon Explorer.
Typestring
Default""

activeIcon​

DescriptionDefines the icon to be displayed in active state as graphical element within the component.
Typestring
Default""

activeArrowButton​

DescriptionDefines whether the arrow button should have the active state styles or not.
Typeboolean
Defaultfalse
Since1.21.0

design​

DescriptionDefines the component design.
Type"Default" | "Positive" | "Negative" | "Transparent" | "Emphasized" | "Attention"
Default"Default"

disabled​

DescriptionDefines whether the component is disabled. A disabled component can't be pressed or focused, and it is not in the tab chain.
Typeboolean
Defaultfalse

accessibleName​

DescriptionDefines the accessible ARIA name of the component.
Typestring | undefined
Defaultundefined

Slots​

default​

DescriptionDefines the text of the component.
Note: Although this slot accepts HTML Elements, it is strongly recommended that you only use text in order to preserve the intended design.
TypeArray<Node>

Events​

click​

DescriptionFired when the user clicks on the default action.
TypeCustomEvent

arrow-click​

DescriptionFired when the user clicks on the arrow action.
TypeCustomEvent

Methods​

No methods available for this component.

CSS Parts​

No CSS parts available for this component.

More Samples​

Design​

The SplitButton supports several designs to indicate the priority or the nature of the action.

Opening Menu​

The main use-case of SplitButton is to open an menu by clicking the arrow.