2016-07-04 10:48:21 +08:00
---
category: Components
2016-11-09 14:43:32 +08:00
type: Navigation
2016-09-21 11:28:38 +08:00
title: Dropdown
2020-06-05 13:50:09 +08:00
cover: https://gw.alipayobjects.com/zos/alicdn/eedWN59yJ/Dropdown.svg
2016-07-04 10:48:21 +08:00
---
A dropdown list.
## When To Use
2019-10-28 09:09:22 +08:00
When there are more than a few options to choose from, you can wrap them in a `Dropdown` . By hovering or clicking on the trigger, a dropdown menu will appear, which allows you to choose an option and execute the relevant action.
2016-07-04 10:48:21 +08:00
## API
### Dropdown
2019-07-11 14:14:33 +08:00
| Property | Description | Type | Default | Version |
| --- | --- | --- | --- | --- |
2020-06-28 22:41:59 +08:00
| arrow | Whether the dropdown arrow should be visible | boolean | false | |
| disabled | Whether the dropdown menu is disabled | boolean | - | |
2020-10-19 11:14:04 +08:00
| getPopupContainer | To set the container of the dropdown menu. The default is to create a div element in body, but you can reset it to the scrolling area and make a relative reposition. [Example on CodePen ](https://codepen.io/afc163/pen/zEjNOy?editors=0010 ) | (triggerNode: HTMLElement) => HTMLElement | () => document.body | |
2019-10-28 09:09:22 +08:00
| overlay | The dropdown menu | [Menu ](/components/menu ) \| () => Menu | - | |
2020-08-18 17:53:21 +08:00
| overlayClassName | The class name of the dropdown root element | string | - | |
2020-10-19 01:06:01 +08:00
| overlayStyle | The style of the dropdown root element | CSSProperties | - | |
2020-06-30 11:25:55 +08:00
| placement | Placement of popup menu: `bottomLeft` , `bottomCenter` , `bottomRight` , `topLeft` , `topCenter` or `topRight` | string | `bottomLeft` | |
| trigger | The trigger mode which executes the dropdown action. Note that hover can't be used on touchscreens | Array< `click`\|`hover` \|`contextMenu` > | \[`hover` ] | |
2019-10-28 09:09:22 +08:00
| visible | Whether the dropdown menu is currently visible | boolean | - | |
2020-10-21 10:33:43 +08:00
| onVisibleChange | Called when the visible state is changed | (visible: boolean) => void | - | |
2016-07-04 10:48:21 +08:00
2017-10-11 17:42:36 +08:00
You should use [Menu ](/components/menu/ ) as `overlay` . The menu items and dividers are also available by using `Menu.Item` and `Menu.Divider` .
2016-07-04 10:48:21 +08:00
> Warning: You must set a unique `key` for `Menu.Item`.
2017-10-25 10:25:44 +08:00
>
2017-09-08 10:09:11 +08:00
> Menu of Dropdown is unselectable by default, you can make it selectable via `<Menu selectable>`.
2017-07-25 18:00:33 +08:00
2016-09-15 01:21:48 +08:00
### Dropdown.Button
2016-07-04 10:48:21 +08:00
2019-05-06 12:04:39 +08:00
| Property | Description | Type | Default | Version |
2019-05-07 14:57:32 +08:00
| --- | --- | --- | --- | --- |
2020-10-21 10:33:43 +08:00
| buttonsRender | Custom buttons inside Dropdown.Button | (buttons: ReactNode\[]) => ReactNode\[] | - | |
2019-10-28 09:09:22 +08:00
| disabled | Whether the dropdown menu is disabled | boolean | - | |
2019-11-20 18:10:44 +08:00
| icon | Icon (appears on the right) | ReactNode | - | |
2019-10-28 09:09:22 +08:00
| overlay | The dropdown menu | [Menu ](/components/menu ) | - | |
2020-06-30 11:25:55 +08:00
| placement | Placement of popup menu: `bottomLeft` `bottomCenter` `bottomRight` `topLeft` `topCenter` `topRight` | string | `bottomLeft` | |
2020-10-19 11:14:04 +08:00
| size | Size of the button, the same as [Button ](/components/button/#API ) | string | `default` | |
2020-06-30 11:25:55 +08:00
| trigger | The trigger mode which executes the dropdown action | Array< `click`\|`hover` \|`contextMenu` > | \[`hover` ] | |
2020-10-19 11:14:04 +08:00
| type | Type of the button, the same as [Button ](/components/button/#API ) | string | `default` | |
2019-10-28 09:09:22 +08:00
| visible | Whether the dropdown menu is currently visible | boolean | - | |
2020-10-21 10:33:43 +08:00
| onClick | The same as [Button ](/components/button/#API ): called when you click the button on the left | (event) => void | - | |
| onVisibleChange | Called when the visible state is changed | (visible: boolean) => void | - | |