Description

Contextual toolbars appear next to an object or selection and focuses on the content-level actions that are available for that item at that given moment in time. Not all actions need to be in a contextual toolbar, as the Application toolbar should carry the complete list of possible actions for that app.

Usage

Use contextual toolbars as a direct and timely shortcut to content-level actions that are housed in application toolbar. If a component has space for its own native controls, such as its own toolbar, buttons, and overflow or contextual menus, then prioritize using these controls for content-level actions before considering contextual toolbars at all.

Anatomy

Contextual toolbars are made up of a series of buttons on a floating bar. Its four main parts include:

Behaviors & Interactions

Access

Contextual toolbars appear when a selection is made and disappear when nothing is selected. Decide on the orientation of the toolbar, either vertical or horizontal, based on how close it needs to appear to the content while being mindful of the information it may cover. For example:

The vertical style is found () to the right side of the selection, and the horizontal style () above or below it. Don't place contextual toolbars on the left side of the selection.

Multiple Options

Bottom triangles act as affordance when multiple options exist under one button. Clicking on a button with this triangle opens an action sheet with all related contextual actions. Because action sheets contain no groupings or nesting, do not use them for showing submenus. If submenus are needed, forgo contextual toolbars altogether and use contextual menus instead.

Contextual Behavior

Contextual toolbars have two styles of offering contextuality:

Regardless of whether the actions are standard or dynamic, they must always be useful in order for the toolbar to maintain its relevance, and not just clutter the UI. The cost of covering up the UI for irrelevant actions is too great to pay for users who would rather just see more of their content.

This contextual behavior includes scenarios where multiple items can be grouped in one selection. To ensure Contextual toolbars remain useful in those scenarios, ensure the actions contained in it apply to the entire group.

Best Practices

Design for speed and relevance

Contextual toolbars are used specifically for their ability to give users what they need, in the moment they are most needed, in order to speed up the user’s flow. If the actions they offer are not relevant at the moment they appear, then the toolbar itself becomes bothersome.

That means contextual toolbars should not offer all the actions that can be done to a selection, but rather, only the ones that are relevant to that moment in time.

To avoid the frustration that comes from the unpredictability of a dynamically changing toolbar, ensure a complete list of these actions is also offered in the menu bar of the application toolbar – either spread within different menus, or all in the same app-specific custom menu. In that sense, contextual toolbars become a shortcut to those actions in a hyper-focused and contextualized way.

Contextual toolbar displaying a focused set of actions contextual to the selection. A complete set of actions are placed in different menus across the application toolbar.

Work with content-level actions

Not all actions are appropriate for a content-level component like a contextual toolbar, even when they will affect the selection. Some appropriate examples include:

warning
What actions should never be placed in a Contextual toolbar? High level actions, general actions, and all actions that need to be accessible at all times. This includes page-level actions, actions that alter the view or layout of the entire UI, or actions to finalize a workflow. See the Action Placement guidelines for more information on Content-level actions.

Not too few, not too many

How many is ‘too many’ actions in a contextual toolbar? How few are ‘too few’? The optimum number lies somewhere between 2 to 8.

In an event, either by its dynamic nature or by design, where a contextual toolbar will be populated with more or less actions than the 2-to-8 range, consider the effect this will have on the user experience and plan for an alternative. For example:

guideline
How to deal with long Contextual toolbars?Instead of long contextual toolbars, consider relying more in the application toolbar. For example, instead of 12 actions in a contextual toolbar, create a custom Object menu on the application toolbar to house all these actions, and place the 8 or less most relevant ones in the contextual toolbar for convenient access.Additionally, use the Called-out Actions section of the application toolbar for anything that needs to be exposed or accessed repeatedly.

Don't let them get covered

Be careful not to let contextual toolbars get covered, either fully or in part, under any circumstances. In certain scenarios, if the regular placement of the toolbar means it will be obscured for whatever reason, consider making minor adjustments to allow it to appear in full. For example, when selecting an item...

Specifications

<div> <div>Badge</div> <div>Component</div> <div>Specification</div> <div>Details</div> </div> <div> <div></div> <div>* Reverse measurements of width and height between vertical and horizontal styles</div> <div> <p>:</p> <ul> <li><em>Width:</em> 2.375rem</li> <li><em>Height min (2 buttons):</em> 3.75rem</li> <li><em>Height max (8 buttons):</em> 18rem</li> </ul> <p>:</p> <ul> <li><em>Width min (2 buttons):</em> 4.5rem</li> <li><em>Width max (8 buttons):</em> 17.25rem</li> <li><em>Height:</em> 2.25rem</li> </ul> <p>: 0.25rem</p> <p>: 0.1875rem</p> <p>@sapUiShadowLevel1</p> </div> <div> <ul> <li><em>Width:</em> 38px</li> <li><em>Height (n buttons)</em>: (28*n+4) px</li> <li><em>Height min (2 buttons):</em> 60px</li> <li><em>Height max (8 buttons):</em> 288px</li> <li><em>Width (n buttons):</em> (34*n+4) px</li> <li><em>Width min (2 buttons):</em> 72px</li> <li><em>Width max (8 buttons):</em> 276px</li> <li><em>Height:</em> 36px</li> </ul> <p>4px</p> <p>: 3px</p> <ul> <li><em>Border:</em> X: 0, Y: 0, blur: 0, spread: 1, #000000, alpha: 15</li> <li><em>Shadow:</em> X: 0, Y: 2, blur: 8, spread: 0, #000000, alpha: 30</li> </ul> </div> </div> <div> <div></div> <div>* Icon is centered vertically and horizontally inside button</div> <div> <p>2rem</p> <p>1.625rem</p> <p>@sapUiButtonLiteBackground</p> <ul> <li><em>Font:</em> FPA-Icons</li> <li><em>Size:</em> 1rem</li> <li><em>Color:</em> @sapUiButtonIconColor</li> </ul> <p>@sapUiButtonLiteHoverBackground</p> <p>@sapUiButtonIconColor #0854A0</p> <p>@sapUiButtonLiteActiveBackground</p> <p>@sapUiButtonActiveTextColor</p> </div> <div> <p>32px</p> <p>26px</p> <p>transparent</p> <ul> <li><em>Font:</em> FPA-Icons</li> <li><em>Size:</em> 16px</li> <li><em>Color:</em> #0854A0</li> </ul> <p>#EBF5FE</p> <p>#0854A0</p> <p>#0854A0</p> <p>#FFFFFF</p> </div> </div> <div> <div></div> <div></div> <div> <p>FPA-Icons</p> <p>select-all-cells</p> <p>&#xe661</p> <p>0.25rem 4px</p> <ul> <li><em>Regular:</em> @sapUiButtonIconColor</li> <li><em>Hover:</em> @sapUiButtonIconColor</li> <li><em>Down:</em> @sapUiButtonActiverTextColor</li> </ul> <p>0.1875rem from right and bottom</p> <p>right-aligned</p> </div> <div> <p>FPA-Icons</p> <p>select-all-cells</p> <p>&#xe661</p> <p>0.25rem 4px</p> <ul> <li><em>Regular:</em> #0854A0</li> <li><em>Hover:</em> #0854A0</li> <li><em>Down:</em> #FFFFFF</li> </ul> <p>3px from right and bottom</p> <p>right-aligned</p> </div> </div> <div> <div></div> <div></div> <div> <ul> <li><em>Width:</em> 1.75rem</li> <li><em>Height:</em> 0.0625rem</li> <li><em>Width:</em> 0.0625rem</li> <li><em>Height:</em> 1.375rem</li> </ul> <p>@sapUiGroupContentBorderColor</p> <p>Divider lines are center-aligned inside the toolbar, placed between buttons.</p> </div> <div> <ul> <li><em>Width:</em> 28px</li> <li><em>Height:</em> 1px</li> <li><em>Width:</em> 1px</li> <li><em>Height:</em> 22px</li> </ul> <p>#D9D9D9</p> <p>Divider lines are center-aligned inside the toolbar, between buttons.</p> </div> </div> <div> <div></div> <div></div> <div> <p>Between buttons and buttons: 0.125rem</p> <p>Between buttons and dividers: 0.125rem</p> </div> <div> <p>Between buttons or dividers: 2px</p> <p>Between buttons and buttons: 2px</p> </div> </div> <div> <div></div> <div></div> <div>The distance between Contextual toolbars and the selection should be 0.375rem</div> <div>The distance between Contextual toolbars and the selection should be 6px</div> </div>

Support

If you have any questions or feedback about this page, please contact our team. For further information and questions in regards to the Design System, please visit the DNA Design SharePoint.