Responsive actions

The responsive actions component allows for the display of actions in a responsive layout. Actions can be presented as persistent, pinned or collapsed to dropdown.

The ResponsiveAction component is used to declare individual actions within the ResponsiveActions wrapper. Each action can be displayed as a standalone button or dropdown based on isPinned and isPersistent properties. Persistent actions are always separate buttons no matter of the screen size. Pinned actions are rendered as buttons as well, but when the screen size is below the defined breakpoint, they get collapsed to the actions dropdown. Other actions render in a dropdown on all screen sizes.

Examples

Basic responsive actions

This example demonstrates how to create responsive actions with persistent and pinned actions.

Breakpoint on container

By passing in the breakpointReference property, the overflow menu's breakpoint will be relative to the width of the reference container rather than the viewport width.

You can change the container width in this example by adjusting the slider. As the container width changes, the actions will change their layout despite the viewport width not changing.

Current container width: 100 %

Props

ResponsiveAction

extends ButtonProps
*required
NameTypeDefaultDescription
childrenrequiredReact.ReactNodeAction label
isPersistentbooleanDetermines whether the action should always be displayed as pinned
isPinnedbooleanDetermines whether the action should be displayed next to dropdown if possible
keystringKey for the action

ResponsiveActions

extends OverflowMenuProps
*required
NameTypeDefaultDescription
childrenrequiredReact.ReactNodeChild actions to be displayed
breakpointOverflowMenuProps['breakpoint']'lg'Indicates breakpoint at which to switch between horizontal menu and vertical dropdown
ouiaIdstring'ResponsiveActions'Custom OUIA ID