PatternFly

Dropdown

A dropdown presents a menu of actions or links in a constrained space that will trigger a process or navigate to a new location. See select component guidelines for more information about making one or more selections from a list of items in a value list.

A newer React implementation of the dropdown has replaced the deprecated implementation. The documentation for the deprecated implementation is under the React deprecated tab, and this deprecated implementation can be imported from @patternfly/react-core/deprecated.

Warning alert:Deprecated feature

This implementation has been deprecated in favor of a newer implementation, and is no longer getting maintained or enhanced. To learn more about the process, visit our about page.

Examples

Expanded

Collapsed

Disabled

Aria disabled items

Kebab

Kebab align right

Align right

Align on different breakpoint

Align top

Plain with text

 
 

Badge toggle

Split button (checkbox)

Split button (checkbox with toggle text)

Split button (progress checkbox)

Split button (action)

Split button, primary (action)

Split button, secondary (action)

With groups

With groups and dividers between groups

With groups and dividers between items

Panel

[Panel contents here]

The dropdown panel is provided for flexibility in allowing various content within a dropdown.

Primary toggle

Secondary toggle

Documentation

Overview

The dropdown menu can contain either links or buttons, depending on the expected behavior when clicking the menu item. If you are using the menu item to navigate to another page, then menu item is a link. Otherwise, use a button for the menu item.

Accessibility

Attribute
Applied
Outcome
aria-expanded="false"
.pf-v5-c-dropdown__toggle, .pf-v5-c-dropdown__toggle-check, .pf-v5-c-dropdown__toggle-button
Indicates that the menu is hidden.
aria-expanded="true"
.pf-v5-c-dropdown__toggle, .pf-v5-c-dropdown__toggle-check, .pf-v5-c-dropdown__toggle-button
Indicates that the menu is visible.
aria-label="Actions"
.pf-v5-c-dropdown__toggle, .pf-v5-c-dropdown__toggle-check, .pf-v5-c-dropdown__toggle-button
Provides an accessible name for the dropdown when an icon is used instead of text. Required when icon is used with no supporting text.
aria-hidden="true"
.pf-v5-c-dropdown__toggle-icon, <i>, .pf-v5-c-dropdown__toggle-check .pf-v5-c-dropdown__toggle-text
Hides the icon from assistive technologies.
hidden
.pf-v5-c-dropdown__menu
Indicates that the menu is hidden so that it isn't visible in the UI and isn't accessed by assistive technologies.
aria-labelledby="{toggle button id}"
.pf-v5-c-dropdown__menu
Gives the menu an accessible name by referring to the element that toggles the menu.
aria-labelledby="{checkbox id} {toggle text id}"
.pf-m-split-button .pf-v5-c-dropdown__toggle-check > input[type="checkbox"]
Gives the checkbox an accessible name by referring to the element by which it is described.
disabled
.pf-v5-c-dropdown__toggle, .pf-v5-c-dropdown__toggle-button, .pf-v5-c-dropdown__toggle-check > input[type="checkbox"]
Disables the dropdown toggle and removes it from keyboard focus.
disabled
button.pf-v5-c-dropdown__menu-item
When the menu item uses a button element, indicates that it is unavailable and removes it from keyboard focus.
aria-disabled="true"
a.pf-v5-c-dropdown__menu-item
When the menu item uses a link element, indicates that it is unavailable.
tabindex="-1"
a.pf-v5-c-dropdown__menu-item
When the menu item uses a link element, removes it from keyboard focus.

Usage

Class
Applied
Outcome
.pf-v5-c-dropdown
<div>
Defines the parent wrapper of the dropdown.
.pf-v5-c-dropdown__toggle
<button>
Defines the dropdown toggle.
.pf-v5-c-dropdown__toggle-icon
<span>
Defines the dropdown toggle icon.
.pf-v5-c-dropdown__toggle-text
<span>
Defines the dropdown toggle text. Required when text is present, adds truncation.
.pf-v5-c-dropdown__toggle-check
<label>
Defines a checkbox in the toggle area of a split button dropdown.
.pf-v5-c-dropdown__toggle-button
<button>
Defines the toggle button for a split button dropdown.
.pf-v5-c-dropdown__toggle-progress
<span>
Defines the progress element to indicate a dropdown action is in progress.
.pf-v5-c-dropdown__menu
<ul>, <div>
Defines the parent wrapper of the menu items.
.pf-v5-c-dropdown__menu-item
<a>
Defines a menu item that navigates to another page.
.pf-v5-c-dropdown__menu-item-icon
<span>
Defines the wrapper for the menu item icon.
.pf-v5-c-dropdown__menu-item-description
<div>
Defines the wrapper for the menu item description.
.pf-v5-c-dropdown__menu-item-main
<div>
Defines the wrapper for the menu item main element. Use when the description element is present.
.pf-v5-c-dropdown__toggle-image
<span>
Defines the wrapper for the dropdown toggle button image.
.pf-v5-c-dropdown__menu-item
<button>
Defines a menu item that performs an action on the current page.
.pf-v5-c-dropdown__group
<section>
Defines a group of items in a dropdown. Required when there is more than one group in a dropdown.
.pf-v5-c-dropdown__group-title
<h1>
Defines the title for a group of items in the dropdown menu.
.pf-m-expanded
.pf-v5-c-dropdown
Modifies for the expanded state.
.pf-m-top
.pf-v5-c-dropdown
Modifies to display the menu above the toggle.
.pf-m-align-left{-on-[breakpoint]}
.pf-v5-c-dropdown__menu
Modifies to display the menu aligned to the left edge of the toggle at optional breakpoint.
.pf-m-align-right{-on-[breakpoint]}
.pf-v5-c-dropdown__menu
Modifies to display the menu aligned to the right edge of the toggle at optional breakpoint.
.pf-m-static
.pf-v5-c-dropdown__menu
Modifies a dropdown menu to be statically positioned to support custom positioning.
.pf-m-split-button
.pf-v5-c-dropdown__toggle
Modifies the dropdown toggle area to allow for interactive elements.
.pf-m-action
.pf-v5-c-dropdown__toggle.pf-m-split-button
Modifies the dropdown toggle for when an action is placed beside a toggle button in a split button dropdown.
.pf-m-text
.pf-v5-c-dropdown__menu-item
Modifies a menu item to be non-interactive text.
.pf-m-plain
.pf-v5-c-dropdown__toggle
Modifies to display the toggle with no border.
.pf-m-text
.pf-v5-c-dropdown__toggle
Modifies the dropdown toggle for the text variation.
.pf-m-primary
.pf-v5-c-dropdown__toggle
Modifies to display the toggle with primary styles.
.pf-m-secondary
.pf-v5-c-dropdown__toggle
Modifies to display the toggle with secondary styles.
.pf-m-full-height
.pf-v5-c-dropdown
Modifies a dropdown to full height of parent. See masthead for use.
.pf-m-disabled
a.pf-v5-c-dropdown__menu-item
Modifies to display the menu item as disabled. This applies to a.pf-v5-c-dropdown__menu-item and should not be used in lieu of the disabled attribute on button.pf-v5-c-dropdown__menu-item.
.pf-m-disabled
div.pf-v5-c-dropdown__toggle
Modifies to display the dropdown toggle as disabled. This applies to div.pf-v5-c-dropdown__toggle and should not be used in lieu of the disabled attribute on button.pf-v5-c-dropdown__toggle. When this is used, disabled should also be added to any form elements in div.pf-v5-c-dropdown__toggle.
.pf-m-icon
.pf-v5-c-dropdown__menu-item
Modifies an item to support adding an icon.
.pf-m-active
.pf-v5-c-dropdown__toggle
Modifies the dropdown menu toggle for the active state.
.pf-m-description
.pf-v5-c-dropdown__menu-item
Modifies an item to support adding a description.
.pf-m-in-progress
.pf-v5-c-dropdown__toggle-check
Modifies a toggle check element to indicate the check action is in progress.

CSS variables

Expand or collapse columnSelectorVariableValue
.pf-v5-c-dropdown--pf-v5-c-dropdown__toggle--PaddingTop
0.375rem
.pf-v5-c-dropdown--pf-v5-c-dropdown__toggle--PaddingRight
0.5rem
.pf-v5-c-dropdown--pf-v5-c-dropdown__toggle--PaddingBottom
0.375rem
.pf-v5-c-dropdown--pf-v5-c-dropdown__toggle--PaddingLeft
0.5rem
.pf-v5-c-dropdown--pf-v5-c-dropdown__toggle--ColumnGap
0.5rem
.pf-v5-c-dropdown--pf-v5-c-dropdown__toggle--MinWidth
0
.pf-v5-c-dropdown--pf-v5-c-dropdown__toggle--FontSize
1rem
.pf-v5-c-dropdown--pf-v5-c-dropdown__toggle--FontWeight
400
.pf-v5-c-dropdown--pf-v5-c-dropdown__toggle--Color
#151515
.pf-v5-c-dropdown--pf-v5-c-dropdown__toggle--LineHeight
1.5
.pf-v5-c-dropdown--pf-v5-c-dropdown__toggle--BackgroundColor
transparent
.pf-v5-c-dropdown--pf-v5-c-dropdown__toggle--before--BorderWidth
1px
.pf-v5-c-dropdown--pf-v5-c-dropdown__toggle--before--BorderTopColor
#f0f0f0
.pf-v5-c-dropdown--pf-v5-c-dropdown__toggle--before--BorderRightColor
#f0f0f0
.pf-v5-c-dropdown--pf-v5-c-dropdown__toggle--before--BorderBottomColor
#8a8d90
.pf-v5-c-dropdown--pf-v5-c-dropdown__toggle--before--BorderLeftColor
#f0f0f0
.pf-v5-c-dropdown--pf-v5-c-dropdown__toggle--hover--before--BorderBottomColor
#06c
.pf-v5-c-dropdown--pf-v5-c-dropdown__toggle--focus--before--BorderBottomWidth
2px
.pf-v5-c-dropdown--pf-v5-c-dropdown__toggle--focus--before--BorderBottomColor
#06c
.pf-v5-c-dropdown--pf-v5-c-dropdown__toggle--active--before--BorderBottomWidth
2px
.pf-v5-c-dropdown--pf-v5-c-dropdown__toggle--active--before--BorderBottomColor
#06c
.pf-v5-c-dropdown--pf-v5-c-dropdown--m-expanded__toggle--before--BorderBottomWidth
2px
.pf-v5-c-dropdown--pf-v5-c-dropdown--m-expanded__toggle--before--BorderBottomColor
#06c
.pf-v5-c-dropdown--pf-v5-c-dropdown__toggle--disabled--BackgroundColor
#f0f0f0
.pf-v5-c-dropdown--pf-v5-c-dropdown__toggle--m-plain--Color
#6a6e73
.pf-v5-c-dropdown--pf-v5-c-dropdown__toggle--m-plain--hover--Color
#151515
.pf-v5-c-dropdown--pf-v5-c-dropdown__toggle--m-plain--disabled--Color
#d2d2d2
.pf-v5-c-dropdown--pf-v5-c-dropdown__toggle--m-plain--PaddingRight
1rem
.pf-v5-c-dropdown--pf-v5-c-dropdown__toggle--m-plain--PaddingLeft
1rem
.pf-v5-c-dropdown--pf-v5-c-dropdown__toggle--m-plain--child--LineHeight
normal
.pf-v5-c-dropdown--pf-v5-c-dropdown__toggle--m-primary--Color
#fff
.pf-v5-c-dropdown--pf-v5-c-dropdown__toggle--m-primary--BorderRadius
3px
.pf-v5-c-dropdown--pf-v5-c-dropdown__toggle--m-primary--BackgroundColor
#06c
.pf-v5-c-dropdown--pf-v5-c-dropdown__toggle--m-primary--hover--BackgroundColor
#004080
.pf-v5-c-dropdown--pf-v5-c-dropdown__toggle--m-primary--focus--BackgroundColor
#004080
.pf-v5-c-dropdown--pf-v5-c-dropdown__toggle--m-primary--active--BackgroundColor
#004080
.pf-v5-c-dropdown--pf-v5-c-dropdown--m-expanded__toggle--m-primary--BackgroundColor
#004080
.pf-v5-c-dropdown--pf-v5-c-dropdown__toggle--m-primary--disabled--Color
#151515
.pf-v5-c-dropdown--pf-v5-c-dropdown__toggle--m-secondary--Color
#06c
.pf-v5-c-dropdown--pf-v5-c-dropdown__toggle--m-secondary--BorderRadius
3px
.pf-v5-c-dropdown--pf-v5-c-dropdown__toggle--m-secondary--BackgroundColor
transparent
.pf-v5-c-dropdown--pf-v5-c-dropdown__toggle--m-secondary--before--BorderWidth
1px
.pf-v5-c-dropdown--pf-v5-c-dropdown__toggle--m-secondary--hover--before--BorderWidth
2px
.pf-v5-c-dropdown--pf-v5-c-dropdown__toggle--m-secondary--focus--before--BorderWidth
2px
.pf-v5-c-dropdown--pf-v5-c-dropdown__toggle--m-secondary--active--before--BorderWidth
2px
.pf-v5-c-dropdown--pf-v5-c-dropdown__toggle--m-secondary--before--BorderColor
#06c
.pf-v5-c-dropdown--pf-v5-c-dropdown__toggle--m-secondary--hover--before--BorderColor
#06c
.pf-v5-c-dropdown--pf-v5-c-dropdown__toggle--m-secondary--focus--before--BorderColor
#06c
.pf-v5-c-dropdown--pf-v5-c-dropdown__toggle--m-secondary--active--before--BorderColor
#06c
.pf-v5-c-dropdown--pf-v5-c-dropdown--m-expanded__toggle--m-secondary--before--BorderWidth
2px
.pf-v5-c-dropdown--pf-v5-c-dropdown--m-expanded__toggle--m-secondary--before--BorderColor
#06c
.pf-v5-c-dropdown--pf-v5-c-dropdown__toggle-button--Color
#151515
.pf-v5-c-dropdown--pf-v5-c-dropdown__toggle-button--BackgroundColor
transparent
.pf-v5-c-dropdown--pf-v5-c-dropdown__toggle-progress--Visibility
hidden
.pf-v5-c-dropdown--pf-v5-c-dropdown__toggle-progress--c-spinner--diameter
0.875rem
.pf-v5-c-dropdown--pf-v5-c-dropdown__toggle--m-split-button--child--PaddingTop
0.375rem
.pf-v5-c-dropdown--pf-v5-c-dropdown__toggle--m-split-button--child--PaddingRight
0.25rem
.pf-v5-c-dropdown--pf-v5-c-dropdown__toggle--m-split-button--child--PaddingBottom
0.375rem
.pf-v5-c-dropdown--pf-v5-c-dropdown__toggle--m-split-button--child--PaddingLeft
0.25rem
.pf-v5-c-dropdown--pf-v5-c-dropdown__toggle--m-split-button--child--BackgroundColor
transparent
.pf-v5-c-dropdown--pf-v5-c-dropdown__toggle--m-split-button--first-child--PaddingLeft
0.5rem
.pf-v5-c-dropdown--pf-v5-c-dropdown__toggle--m-split-button--last-child--PaddingRight
0.5rem
.pf-v5-c-dropdown--pf-v5-c-dropdown__toggle--m-split-button--m-action--child--PaddingLeft
0.5rem
.pf-v5-c-dropdown--pf-v5-c-dropdown__toggle--m-split-button--m-action--child--PaddingRight
0.5rem
.pf-v5-c-dropdown--pf-v5-c-dropdown__toggle--m-split-button--m-action__toggle-button--MarginRight
calc(-1 * 1px)
.pf-v5-c-dropdown--pf-v5-c-dropdown__toggle--m-split-button__toggle-text--MarginLeft
0.5rem
.pf-v5-c-dropdown--pf-v5-c-dropdown__toggle--m-split-button--child--BorderRadius
3px
.pf-v5-c-dropdown--pf-v5-c-dropdown__toggle--m-split-button--m-primary--child--BorderRadius
3px
.pf-v5-c-dropdown--pf-v5-c-dropdown__toggle--m-split-button--m-primary--child--BackgroundColor
#06c
.pf-v5-c-dropdown--pf-v5-c-dropdown__toggle--m-split-button--m-primary--child--hover--BackgroundColor
#004080
.pf-v5-c-dropdown--pf-v5-c-dropdown__toggle--m-split-button--m-primary--child--focus--BackgroundColor
#004080
.pf-v5-c-dropdown--pf-v5-c-dropdown__toggle--m-split-button--m-primary--child--active--BackgroundColor
#004080
.pf-v5-c-dropdown--pf-v5-c-dropdown__toggle--m-split-button--m-primary--child--m-expanded--BackgroundColor
#004080
.pf-v5-c-dropdown--pf-v5-c-dropdown__toggle--m-split-button--m-primary--m-action--child--BorderLeftColor
#004080
.pf-v5-c-dropdown--pf-v5-c-dropdown__toggle--m-split-button--m-primary--m-action--child--BorderLeftWidth
1px
.pf-v5-c-dropdown--pf-v5-c-dropdown--m-expanded__toggle--m-secondary--m-split-button--child--before--BorderWidth
2px
.pf-v5-c-dropdown--pf-v5-c-dropdown__toggle--m-secondary--m-split-button--Color
#06c
.pf-v5-c-dropdown--pf-v5-c-dropdown__toggle--m-secondary--m-split-button--hover--before--BorderWidth
2px
.pf-v5-c-dropdown--pf-v5-c-dropdown__toggle--m-secondary--m-split-button--focus--before--BorderWidth
2px
.pf-v5-c-dropdown--pf-v5-c-dropdown__toggle--m-secondary--m-split-button--active--before--BorderWidth
2px
.pf-v5-c-dropdown--pf-v5-c-dropdown__toggle--m-secondary--m-split-button--child--before--BorderWidth--base
1px
.pf-v5-c-dropdown--pf-v5-c-dropdown__toggle--m-secondary--m-split-button--child--before--BorderColor--base
#06c
.pf-v5-c-dropdown--pf-v5-c-dropdown__toggle--m-secondary--m-split-button--child--before--BorderColor
#06c
.pf-v5-c-dropdown--pf-v5-c-dropdown__toggle--m-secondary--m-split-button--child--before--BorderWidth
1px
.pf-v5-c-dropdown--pf-v5-c-dropdown__toggle--m-secondary--m-split-button--child--before--hover--BorderWidth
2px
.pf-v5-c-dropdown--pf-v5-c-dropdown__toggle--m-secondary--m-split-button--child--before--focus--BorderWidth
2px
.pf-v5-c-dropdown--pf-v5-c-dropdown__toggle--m-secondary--m-split-button--child--before--active--BorderWidth
2px
.pf-v5-c-dropdown--pf-v5-c-dropdown__toggle-icon--LineHeight
1.5
.pf-v5-c-dropdown--pf-v5-c-dropdown__toggle-icon--PaddingRight
0.5rem
.pf-v5-c-dropdown--pf-v5-c-dropdown__toggle-icon--PaddingLeft
0.5rem
.pf-v5-c-dropdown--pf-v5-c-dropdown__toggle-icon--MarginLeft
0
.pf-v5-c-dropdown--pf-v5-c-dropdown--m-top--m-expanded__toggle-icon--Rotate
180deg
.pf-v5-c-dropdown--pf-v5-c-dropdown--m-plain__toggle-icon--Color
#6a6e73
.pf-v5-c-dropdown--pf-v5-c-dropdown--m-plain--hover__toggle-icon--Color
#151515
.pf-v5-c-dropdown--pf-v5-c-dropdown__menu--BackgroundColor
#fff
.pf-v5-c-dropdown--pf-v5-c-dropdown__menu--BoxShadow
0 0.25rem 0.5rem 0rem rgba(3, 3, 3, 0.12), 0 0 0.25rem 0 rgba(3, 3, 3, 0.06)
.pf-v5-c-dropdown--pf-v5-c-dropdown__menu--PaddingTop
0.5rem
.pf-v5-c-dropdown--pf-v5-c-dropdown__menu--PaddingBottom
0.5rem
.pf-v5-c-dropdown--pf-v5-c-dropdown__menu--Top
calc(100% + 0.25rem)
.pf-v5-c-dropdown--pf-v5-c-dropdown__menu--ZIndex
200
.pf-v5-c-dropdown--pf-v5-c-dropdown--m-top__menu--Top
0
.pf-v5-c-dropdown--pf-v5-c-dropdown--m-top__menu--TranslateY
calc(-100% - 0.25rem)
.pf-v5-c-dropdown--pf-v5-c-dropdown__menu-item--BackgroundColor
transparent
.pf-v5-c-dropdown--pf-v5-c-dropdown__menu-item--PaddingTop
0.5rem
.pf-v5-c-dropdown--pf-v5-c-dropdown__menu-item--PaddingRight
1rem
.pf-v5-c-dropdown--pf-v5-c-dropdown__menu-item--PaddingBottom
0.5rem
.pf-v5-c-dropdown--pf-v5-c-dropdown__menu-item--PaddingLeft
1rem
.pf-v5-c-dropdown--pf-v5-c-dropdown__menu-item--FontSize
1rem
.pf-v5-c-dropdown--pf-v5-c-dropdown__menu-item--FontWeight
400
.pf-v5-c-dropdown--pf-v5-c-dropdown__menu-item--LineHeight
1.5
.pf-v5-c-dropdown--pf-v5-c-dropdown__menu-item--Color
#151515
.pf-v5-c-dropdown--pf-v5-c-dropdown__menu-item--hover--Color
#151515
.pf-v5-c-dropdown--pf-v5-c-dropdown__menu-item--disabled--Color
#6a6e73
.pf-v5-c-dropdown--pf-v5-c-dropdown__menu-item--hover--BackgroundColor
#f0f0f0
.pf-v5-c-dropdown--pf-v5-c-dropdown__menu-item--disabled--BackgroundColor
transparent
.pf-v5-c-dropdown--pf-v5-c-dropdown__menu-item--m-text--Color
#6a6e73
.pf-v5-c-dropdown--pf-v5-c-dropdown__menu-item-icon--MarginRight
0.5rem
.pf-v5-c-dropdown--pf-v5-c-dropdown__menu-item-icon--Width
1.5rem
.pf-v5-c-dropdown--pf-v5-c-dropdown__menu-item-icon--Height
1.5rem
.pf-v5-c-dropdown--pf-v5-c-dropdown__menu-item-description--FontSize
0.75rem
.pf-v5-c-dropdown--pf-v5-c-dropdown__menu-item-description--Color
#6a6e73
.pf-v5-c-dropdown--pf-v5-c-dropdown__group--group--PaddingTop
0.5rem
.pf-v5-c-dropdown--pf-v5-c-dropdown__group-title--PaddingTop
0.5rem
.pf-v5-c-dropdown--pf-v5-c-dropdown__group-title--PaddingRight
1rem
.pf-v5-c-dropdown--pf-v5-c-dropdown__group-title--PaddingBottom
0.5rem
.pf-v5-c-dropdown--pf-v5-c-dropdown__group-title--PaddingLeft
1rem
.pf-v5-c-dropdown--pf-v5-c-dropdown__group-title--FontSize
0.75rem
.pf-v5-c-dropdown--pf-v5-c-dropdown__group-title--FontWeight
400
.pf-v5-c-dropdown--pf-v5-c-dropdown__group-title--Color
#6a6e73
.pf-v5-c-dropdown--pf-v5-c-dropdown--c-divider--MarginTop
0.5rem
.pf-v5-c-dropdown--pf-v5-c-dropdown--c-divider--MarginBottom
0.5rem
.pf-v5-c-dropdown--pf-v5-c-dropdown__toggle--c-badge__toggle-icon--PaddingRight
0
.pf-v5-c-dropdown--pf-v5-c-dropdown__toggle--c-badge__toggle-icon--PaddingLeft
0
.pf-v5-c-dropdown--pf-v5-c-dropdown__toggle--c-badge__toggle-icon--MarginLeft
0.25rem
.pf-v5-c-dropdown--pf-v5-c-dropdown__toggle--c-badge__toggle-icon--MarginRight
0
.pf-v5-c-dropdown--pf-v5-c-dropdown--c-menu--Top
calc(100% + 0.25rem)
.pf-v5-c-dropdown--pf-v5-c-dropdown--c-menu--ZIndex
200