JGuang

CascaderView

CascaderView · Ant Design Mobile

Preview
npm install antd-mobile@5.43.0

CascaderView

CascaderView is the content area of Cascader.

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.

CascaderView is the content area of Cascader.

Demos

CascaderView

Props

NameDescriptionTypeDefault
activeIconThe icon displayed when selectedReactNode-
defaultValueDefault selected optionsCascaderValue[][]
fieldNamesCustom field name for label and value and disabled and children{ label: string, value: string, disabled: string, children: string }{ label: 'label', value: 'value',disabled:'disabled', children: 'children' }
onChangeTriggered when the selected options are changed(value: CascaderValue[], extend: CascaderValueExtend) => void-
onTabsChangeCallback when switching panel(index: number) => void-
optionsData of the cascade optionsCascaderOption[]-
placeholderHint textstring | (index: number) => string'请选择'
valueSelected optionsCascaderValue[]-
loadingOpen the skeleton screenbooleanfalse
optionRenderCustom render function for options(option: CascaderOption, info: { depth: number, active: boolean }) => ReactNode-

For the type definition of CascaderValue CascaderOption CascaderValueExtend, please refer to the document of Cascader.

Loading <Experimental></Experimental>

You can pass CascaderView.optionSkeleton as CascaderOption[] to the options property of CascaderView or the children of CascaderOption. CascaderView will recognize it and display the skeleton screen effect.

CSS Variables

NameDescriptionDefault
--heightheight of the CascaderViewauto