Overflow menu

Examples

Simple (responsive)

Item
Item
Item
Item
Item

Vertical

Passing isVertical to OverflowMenu will change its behavior to respond to breakpoints based on window height instead of width.

Item
Item
Item
Item
Item

Group types

Item
Item
Item

Multiple groups

Persistent

Breakpoint on container width

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 overflow menu will change between a horizontal menu and a vertical dropdown despite the viewport width not changing.

Current container width: 100 %
Item 1
Item 2
Item 3
Item 4
Item 5

Breakpoint on container height

By passing in the breakpointReference and isVertical properties, the overflow menu's breakpoint will be determined relative to the height of the reference container rather than the window height.

Breakpoint on container height screenshot

Props

OverflowMenu

*required
NameTypeDefaultDescription
breakpointrequired'sm' | 'md' | 'lg' | 'xl' | '2xl'Indicates breakpoint at which to switch between expanded and collapsed states. The "sm" breakpoint does not apply to vertical overflow menus.
breakpointReferenceHTMLElement | (() => HTMLElement) | React.RefObject<any>A container reference to base the specified breakpoint on instead of the viewport width.
childrenanyAny elements that can be rendered in the menu
classNamestringAdditional classes added to the OverflowMenu.
isVerticalbooleanfalseIndicates the overflow menu orientation is vertical and should respond to height changes instead of width.

OverflowMenuContent

*required
NameTypeDefaultDescription
childrenanyAny elements that can be rendered in the menu
classNamestringAdditional classes added to the OverflowMenuContent
isPersistentbooleanModifies the overflow menu content visibility

OverflowMenuControl

*required
NameTypeDefaultDescription
childrenanyAny elements that can be rendered in the menu
classNamestringAdditional classes added to the OverflowMenuControl
hasAdditionalOptionsbooleanTriggers the overflow dropdown to persist at all viewport sizes

OverflowMenuDropdownItem

*required
NameTypeDefaultDescription
isSharedbooleanfalseIndicates when a dropdown item shows and hides the corresponding list item
itemIdstring | numberIdentifies the component in the dropdown onSelect callback

OverflowMenuGroup

*required
NameTypeDefaultDescription
childrenanyAny elements that can be rendered in the menu
classNamestringAdditional classes added to the OverflowMenuGroup
groupType'button' | 'icon'Indicates a button or icon group
isPersistentbooleanfalseModifies the overflow menu group visibility

OverflowMenuItem

*required
NameTypeDefaultDescription
childrenanyAny elements that can be rendered in the menu
classNamestringAdditional classes added to the OverflowMenuItem
isPersistentbooleanfalseModifies the overflow menu item visibility

CSS variables

Expand or collapse columnSelectorVariableValue
.pf-v6-c-overflow-menu--pf-v6-c-overflow-menu--ColumnGap
1rem
.pf-v6-c-overflow-menu--pf-v6-c-overflow-menu--RowGap
1rem
.pf-v6-c-overflow-menu--pf-v6-c-overflow-menu__group--ColumnGap
1rem
.pf-v6-c-overflow-menu--pf-v6-c-overflow-menu__group--RowGap
1rem
.pf-v6-c-overflow-menu--pf-v6-c-overflow-menu__group--m-button-group--ColumnGap
0.5rem
.pf-v6-c-overflow-menu--pf-v6-c-overflow-menu__group--m-button-group--RowGap
0.5rem
.pf-v6-c-overflow-menu--pf-v6-c-overflow-menu__group--m-icon-button-group--ColumnGap
0.25rem
.pf-v6-c-overflow-menu--pf-v6-c-overflow-menu__group--m-icon-button-group--RowGap
0.25rem