Title: Dropdown
Published: March 9, 2021
Last modified: October 14, 2026

---

# Dropdown

## In this article

 * [Usage](https://developer.wordpress.org/block-editor/reference-guides/components/dropdown/?output_format=md#usage)
 * [Props](https://developer.wordpress.org/block-editor/reference-guides/components/dropdown/?output_format=md#props)
    - [className: string](https://developer.wordpress.org/block-editor/reference-guides/components/dropdown/?output_format=md#classname-string)
    - [contentClassName: string](https://developer.wordpress.org/block-editor/reference-guides/components/dropdown/?output_format=md#contentclassname-string)
    - [defaultOpen: boolean](https://developer.wordpress.org/block-editor/reference-guides/components/dropdown/?output_format=md#defaultopen-boolean)
    - [expandOnMobile: boolean](https://developer.wordpress.org/block-editor/reference-guides/components/dropdown/?output_format=md#expandonmobile-boolean)
    - [focusOnMount: ‘firstElement’ | boolean](https://developer.wordpress.org/block-editor/reference-guides/components/dropdown/?output_format=md#focusonmount-firstelement-boolean)
    - [headerTitle: string](https://developer.wordpress.org/block-editor/reference-guides/components/dropdown/?output_format=md#headertitle-string)
    - [onClose: () => void](https://developer.wordpress.org/block-editor/reference-guides/components/dropdown/?output_format=md#onclose-void)
    - [open: boolean](https://developer.wordpress.org/block-editor/reference-guides/components/dropdown/?output_format=md#open-boolean)
    - [onToggle: ( willOpen: boolean ) => void](https://developer.wordpress.org/block-editor/reference-guides/components/dropdown/?output_format=md#ontoggle-willopen-boolean-void)
    - [popoverProps: WordPressComponentProps< Omit< PopoverProps, ‘children’ > ‘div’, false >](https://developer.wordpress.org/block-editor/reference-guides/components/dropdown/?output_format=md#popoverprops-wordpresscomponentprops-omit-popoverprops-children-div-false)
    - [renderContent: ( props: CallbackProps ) => ReactNode](https://developer.wordpress.org/block-editor/reference-guides/components/dropdown/?output_format=md#rendercontent-props-callbackprops-reactnode)
    - [renderToggle: ( props: CallbackProps ) => ReactNode](https://developer.wordpress.org/block-editor/reference-guides/components/dropdown/?output_format=md#rendertoggle-props-callbackprops-reactnode)
    - [style: React.CSSProperties](https://developer.wordpress.org/block-editor/reference-guides/components/dropdown/?output_format=md#style-react-cssproperties)

Dropdown is a React component to render a button that opens a floating content modal
when clicked.

This component takes care of updating the state of the dropdown menu (opened/closed),
handles closing the menu when clicking outside and uses render props to render the
button and the content.

## 󠀁[Usage](https://developer.wordpress.org/block-editor/reference-guides/components/dropdown/?output_format=md#usage)󠁿

    ```language-jsx
    import { Button, Dropdown } from '@wordpress/components';

    const MyDropdown = () => (
        <Dropdown
            className="my-container-class-name"
            contentClassName="my-popover-content-classname"
            popoverProps={ { placement: 'bottom-start' } }
            renderToggle={ ( { isOpen, onToggle } ) => (
                <Button
                    variant="primary"
                    onClick={ onToggle }
                    aria-expanded={ isOpen }
                >
                    Toggle Popover!
                </Button>
            ) }
            renderContent={ () => <div>This is the content of the popover.</div> }
        />
    );
    ```

## 󠀁[Props](https://developer.wordpress.org/block-editor/reference-guides/components/dropdown/?output_format=md#props)󠁿

The component accepts the following props. Props not included in this set will be
applied to the element wrapping Popover content.

### 󠀁[className: string](https://developer.wordpress.org/block-editor/reference-guides/components/dropdown/?output_format=md#classname-string)󠁿

className of the global container

 * Required: No

### 󠀁[contentClassName: string](https://developer.wordpress.org/block-editor/reference-guides/components/dropdown/?output_format=md#contentclassname-string)󠁿

If you want to target the dropdown menu for styling purposes, you need to provide
a contentClassName because it’s not being rendered as a child of the container node.

 * Required: No

### 󠀁[defaultOpen: boolean](https://developer.wordpress.org/block-editor/reference-guides/components/dropdown/?output_format=md#defaultopen-boolean)󠁿

The open state of the dropdown when initially rendered. Use when you do not need
to control its open state. It will be overridden by the `open` prop if it is specified
on the component’s first render.

 * Required: No

### 󠀁[expandOnMobile: boolean](https://developer.wordpress.org/block-editor/reference-guides/components/dropdown/?output_format=md#expandonmobile-boolean)󠁿

Opt-in prop to show popovers fullscreen on mobile.

 * Required: No
 * Default: `false`

### 󠀁[focusOnMount: ‘firstElement’ | boolean](https://developer.wordpress.org/block-editor/reference-guides/components/dropdown/?output_format=md#focusonmount-firstelement-boolean)󠁿

By default, the _first tabbable element_ in the popover will receive focus when 
it mounts. This is the same as setting this prop to `"firstElement"`.

Specifying a `true` value will focus the container instead.

Specifying a `false` value disables the focus handling entirely (this should only
be done when an appropriately accessible substitute behavior exists).

 * Required: No
 * Default: `"firstElement"`

### 󠀁[headerTitle: string](https://developer.wordpress.org/block-editor/reference-guides/components/dropdown/?output_format=md#headertitle-string)󠁿

Set this to customize the text that is shown in the dropdown’s header when it is
fullscreen on mobile.

 * Required: No

### 󠀁[onClose: () => void](https://developer.wordpress.org/block-editor/reference-guides/components/dropdown/?output_format=md#onclose-void)󠁿

A callback invoked when the popover should be closed.

 * Required: No

### 󠀁[open: boolean](https://developer.wordpress.org/block-editor/reference-guides/components/dropdown/?output_format=md#open-boolean)󠁿

The controlled open state of the dropdown. Must be used in conjunction with `onToggle`.

 * Required: No

### 󠀁[onToggle: ( willOpen: boolean ) => void](https://developer.wordpress.org/block-editor/reference-guides/components/dropdown/?output_format=md#ontoggle-willopen-boolean-void)󠁿

A callback invoked when the state of the dropdown changes from open to closed and
vice versa.

 * Required: No

### 󠀁[popoverProps: WordPressComponentProps< Omit< PopoverProps, ‘children’ > ‘div’, false >](https://developer.wordpress.org/block-editor/reference-guides/components/dropdown/?output_format=md#popoverprops-wordpresscomponentprops-omit-popoverprops-children-div-false)󠁿

Properties of popoverProps object will be passed as props to the `Popover` component.

Use this object to access properties/features of the `Popover` component that are
not already exposed in the `Dropdown` component, e.g.: the ability to have the popover
without an arrow.

 * Required: No

### 󠀁[renderContent: ( props: CallbackProps ) => ReactNode](https://developer.wordpress.org/block-editor/reference-guides/components/dropdown/?output_format=md#rendercontent-props-callbackprops-reactnode)󠁿

A callback invoked to render the content of the dropdown menu.

 * `isOpen`: whether the dropdown menu is opened or not
 * `onToggle`: A function switching the dropdown menu’s state from open to closed
   and vice versa
 * `onClose`: A function that closes the menu if invoked
 * Required: Yes

### 󠀁[renderToggle: ( props: CallbackProps ) => ReactNode](https://developer.wordpress.org/block-editor/reference-guides/components/dropdown/?output_format=md#rendertoggle-props-callbackprops-reactnode)󠁿

A callback invoked to render the Dropdown Toggle Button.

Its props are the same as the `renderContent` props.

 * Required: Yes

### 󠀁[style: React.CSSProperties](https://developer.wordpress.org/block-editor/reference-guides/components/dropdown/?output_format=md#style-react-cssproperties)󠁿

The style of the global container

 * Required: No

First published

March 9, 2021

Last updated

October 14, 2026

Edit article

[ Improve it on GitHub: Dropdown ](https://github.com/WordPress/gutenberg/edit/trunk/packages/components/src/dropdown/README.md)

[  Previous: DropdownMenu](https://developer.wordpress.org/block-editor/reference-guides/components/dropdown-menu/)

[  Next: DuotonePicker](https://developer.wordpress.org/block-editor/reference-guides/components/duotone-picker/)