logoNamu Design

⌘ K
  • Design
  • Development
  • Components
  • Blog
  • Resources
1.0.0
  • Components Overview
  • General
    • Button
    • FloatButtonNew
    • Icon
    • Typography
  • Layout
    • Divider
    • Grid
    • Layout
    • Space
  • Navigation
    • Anchor
    • Breadcrumb
    • Dropdown
    • Menu
    • Pagination
    • Steps
  • Data Entry
    • AutoComplete
    • Cascader
    • Checkbox
    • ColorPickerNew
    • DatePicker
    • Form
    • Input
    • InputNumber
    • Mentions
    • Radio
    • Rate
    • Select
    • Slider
    • Switch
    • TimePicker
    • Transfer
    • TreeSelect
    • Upload
  • Data Display
    • Avatar
    • Badge
    • Calendar
    • Card
    • Carousel
    • Collapse
    • Descriptions
    • Empty
    • Image
    • List
    • Popover
    • QRCodeNew
    • Segmented
    • Statistic
    • Table
    • Tabs
    • Tag
    • Timeline
    • Tooltip
    • TourNew
    • Tree
  • Feedback
    • Alert
    • Drawer
    • Message
    • Modal
    • Notification
    • Popconfirm
    • Progress
    • Result
    • Skeleton
    • Spin
    • Watermark
  • Other
    • Affix
    • AppNew
    • ConfigProvider
When To Use
Examples
Basic
Placement
Arrow
Other elements
Arrow pointing at the center
Trigger mode
Click event
Button with dropdown menu
Custom dropdown
Cascading menu
The way of hiding menu.
Context Menu
Loading
Selectable Menu
API
Dropdown
Dropdown.Button
Note
Design Token
FAQ
How to prevent Dropdown from being squeezed when it exceeds the screen horizontally?

Dropdown

  • BreadcrumbMenu

    Resources

    Namu Design Charts
    Namu Design Pro
    Namu Design Pro Components
    Namu Design Mobile
    Namu Design Mini
    Namu Design Landing-Landing Templates
    Scaffolds-Scaffold Market
    Umi-React Application Framework
    dumi-Component doc generator
    qiankun-Micro-Frontends Framework
    ahooks-React Hooks Library
    Ant Motion-Motion Solution
    China Mirror 🇨🇳

    Community

    Awesome Namu Design
    Medium
    Twitter
    yuqueNamu Design in YuQue
    Namu Design in Zhihu
    Experience Cloud Blog
    seeconfSEE Conf-Experience Tech Conference

    Help

    GitHub
    Change Log
    FAQ
    Bug Report
    Issues
    Discussions
    StackOverflow
    SegmentFault

    Ant XTechMore Products

    yuqueYuQue-Document Collaboration Platform
    AntVAntV-Data Visualization
    EggEgg-Enterprise Node.js Framework
    kitchenKitchen-Sketch Toolkit
    xtechAnt Financial Experience Tech
    Theme Editor
    Made with ❤ by
    Ant Group and Namu Design Community

    A dropdown list.

    When To Use

    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.

    Examples

    Basic

    The most basic dropdown menu.

    expand codeexpand code
    Arrow

    You could display an arrow.

    expand codeexpand code
    Arrow pointing at the center

    By specifying arrow prop with { pointAtCenter: true }, the arrow will point to the center of the target element.

    expand codeexpand code
    Click event

    An event will be triggered when you click menu items, in which you can make different operations according to item's key.

    expand codeexpand code
    Custom dropdown

    Customize the dropdown menu via dropdownRender. If you don't need the Menu content, use the Popover component directly.

    expand codeexpand code
    The way of hiding menu.

    The default is to close the menu when you click on menu items, this feature can be turned off.

    expand codeexpand code
    Loading

    A loading indicator can be added to a button by setting the loading property on the Dropdown.Button.

    expand codeexpand code
    Placement

    Support 6 placements.

    expand codeexpand code
    Other elements

    Divider and disabled menu item.

    expand codeexpand code
    Trigger mode

    The default trigger mode is hover, you can change it to click.

    expand codeexpand code
    Button with dropdown menu

    A button is on the left, and a related functional menu is on the right. You can set the icon property to modify the icon of right.

    expand codeexpand code
    Cascading menu

    The menu has multiple levels.

    expand codeexpand code
    Context Menu

    The default trigger mode is hover, you can change it to contextMenu.

    expand codeexpand code
    Selectable Menu

    Configure the selectable property in menu to enable selectable ability.

    expand codeexpand code

    API

    Common props ref:Common props

    Dropdown

    PropertyDescriptionTypeDefaultVersion
    arrowWhether the dropdown arrow should be visibleboolean | { pointAtCenter: boolean }false
    autoAdjustOverflowWhether to adjust dropdown placement automatically when dropdown is off screenbooleantrue5.2.0
    autoFocusFocus element in overlay when openedbooleanfalse4.21.0
    disabledWhether the dropdown menu is disabledboolean-
    destroyPopupOnHideWhether destroy dropdown when hiddenbooleanfalse
    dropdownRenderCustomize dropdown content(menus: ReactNode) => ReactNode-4.24.0
    getPopupContainerTo 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(triggerNode: HTMLElement) => HTMLElement() => document.body
    menuThe menu propsMenuProps-4.24.0
    overlayClassNameThe class name of the dropdown root elementstring-
    overlayStyleThe style of the dropdown root elementCSSProperties-
    placementPlacement of popup menu: bottom bottomLeft bottomRight top topLeft topRightstringbottomLeft
    triggerThe trigger mode which executes the dropdown action. Note that hover can't be used on touchscreensArray<click|hover|contextMenu>[hover]
    openWhether the dropdown menu is currently open. Use visible under 4.23.0 (why?)boolean-4.23.0
    onOpenChangeCalled when the open state is changed. Not trigger when hidden by click item. Use onVisibleChange under 4.23.0 (why?)(open: boolean) => void-4.23.0

    Dropdown.Button

    Same props from Dropdown. And includes additional props:

    PropertyDescriptionTypeDefaultVersion
    buttonsRenderCustom buttons inside Dropdown.Button(buttons: ReactNode[]) => ReactNode[]-
    loadingSet the loading status of buttonboolean | { delay: number }false
    dangerSet the danger status of buttonboolean-4.23.0
    iconIcon (appears on the right)ReactNode-
    sizeSize of the button, the same as Buttonstringdefault
    typeType of the button, the same as Buttonstringdefault
    onClickThe same as Button: called when you click the button on the left(event) => void-

    Note

    Please ensure that the child node of Dropdown accepts onMouseEnter, onMouseLeave, onFocus, onClick events.

    Design Token

    Component Token

    Global Token

    FAQ

    How to prevent Dropdown from being squeezed when it exceeds the screen horizontally?

    You can use width: max-content style to handle this. ref #43025.

    Hover me


    Hover me, Click menu item
    Hover me
    Hover me
    Hover me
    Click me
    Cascading menu
    Right Click on here
    Selectable