JGuang

Dropdown <Experimental></Experimental>

Dropdown <Experimental></Experimental> · Ant Design Mobile

Preview
npm install antd-mobile@5.43.0

Dropdown <Experimental></Experimental>

The menu panel that pops down.

Install

npm install antd-mobile@5.43.0

antd-mobile is for mobile web, not React Native or Mini Programs. React 19 projects must register createRoot with unstableSetRender at the entry, or imperative APIs such as Toast and Dialog cannot render. Switch dark mode with <html data-prefers-color-scheme="dark">.

Examples come from the official Ant Design Mobile repository (MIT) at the commit published as npm 5.43.0. Presentation helpers such as DemoBlock are JGuang rewrites, not antd-mobile APIs.

The menu panel that pops down.

When to Use

It is suitable for filtering, sorting and changing the display range or order of the current page content.

Demos

Props

NameDescriptionTypeDefault
activeKeyActive Item keystring | null-
arrowIconCustom arrow iconReact.ReactNode-
closeOnClickAwayWhether to automatically hide after clicking outside areabooleanfalse
closeOnMaskClickWhether to automatically close after clicking on the maskbooleantrue
defaultActiveKeyThe default active Item keystring | nullnull
onChangeTriggered when activeKey changes(activeKey: string | null)=> void-
onVisibleChangeTriggered when the dropdown panel is shown or hidden(visible: boolean, info: { key: string | null }) => void-
getContainerThe parent container of the custom popupHTMLElement | (() => HTMLElement) | nulldocument.body

Ref

NameDescriptionType
closeClose the Dropdown() => void

Props

NameDescriptionTypeDefault
arrowIconCustom arrow iconReact.ReactNode-
destroyOnCloseDestroy dom when not visiblebooleanfalse
forceRenderWhether to render the content even if it is not activebooleanfalse
highlightHighlightbooleanfalse
keyThe unique valuestring-
titleTitleReactNode-
onClickThe click event(event: React.MouseEvent<HTMLDivElement, MouseEvent>) => void-