rc-cascader
cascade select ui component for react
Last updated 6 years ago by yesmeck .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install rc-cascader 
SYNC missed versions from official npm registry.

rc-cascader

React Cascader Component

NPM version npm download build status Codecov bundle size dumi

Browser Support

IE / Edge
IE / Edge
Firefox
Firefox
Chrome
Chrome
Safari
Safari
Electron
Electron
IE11, Edge last 2 versions last 2 versions last 2 versions last 2 versions

Screenshots

Example

https://cascader-react-component.vercel.app

Install

rc-cascader

$ npm install rc-cascader --save

Usage

import React from 'react';
import Cascader from 'rc-cascader';

const options = [{
  'label': '福建',
  'value': 'fj',
  'children': [{
    'label': '福州',
    'value': 'fuzhou',
    'children': [{
      'label': '马尾',
      'value': 'mawei',
    }],
  }, {
    'label': '泉州',
    'value': 'quanzhou',
  }],
}, {
  'label': '浙江',
  'value': 'zj',
  'children': [{
    'label': '杭州',
    'value': 'hangzhou',
    'children': [{
      'label': '余杭',
      'value': 'yuhang',
    }],
  }],
}, {
  'label': '北京',
  'value': 'bj',
  'children': [{
    'label': '朝阳区',
    'value': 'chaoyang',
  }, {
    'label': '海淀区',
    'value': 'haidian',
  }],
}];

React.render(
  <Cascader options={options}>
    ...
  </Cascader>
, container);

API

props

name type default description
autoClearSearchValue boolean true Whether the current search will be cleared on selecting an item. Only applies when checkable
options Object The data options of cascade
value Array selected value
defaultValue Array initial selected value
onChange Function(value, selectedOptions) callback when finishing cascader select
changeOnSelect Boolean false change value on each selection
loadData Function(selectedOptions) callback when click any option, use for loading more options
expandTrigger String 'click' expand current item when click or hover
open Boolean visibility of popup overlay
onDropdownVisibleChange Function(visible) callback when popup overlay's visibility changed
transitionName String transition className like "slide-up"
prefixCls String rc-cascader prefix className of popup overlay
dropdownClassName String additional className of popup overlay
popupPlacement String bottomLeft use preset popup align config from builtinPlacements:bottomRight topRight bottomLeft topLeft
getPopupContainer function(trigger:Node):Node () => document.body container which popup select menu rendered into
dropdownMenuColumnStyle Object style object for each cascader pop menu
fieldNames Object { label: 'label', value: 'value', children: 'children' } custom field name for label and value and children
expandIcon ReactNode > specific the default expand icon
loadingIcon ReactNode > specific the default loading icon
hidePopupOnSelect Boolean >true hide popup on select

option

name type default description
label String option text to display
value String option value as react key
disabled Boolean disabled option
children Array children options

Development

$ npm install
$ npm start

Test Case

$ npm test

Coverage

$ npm run coverage

License

rc-cascader is released under the MIT license.

Current Tags

  • 3.31.0                                ...           latest (23 days ago)

171 Versions

  • 3.31.0                                ...           23 days ago
  • 3.30.0                                ...           2 months ago
  • 3.29.1                                ...           2 months ago
  • 3.29.0                                ...           2 months ago
  • 3.28.2                                ...           2 months ago
  • 3.28.1                                ...           4 months ago
  • 3.28.0                                ...           4 months ago
  • 3.27.1                                ...           4 months ago
  • 3.27.0                                ...           6 months ago
  • 3.26.0                                ...           7 months ago
  • 3.25.0                                ...           8 months ago
  • 3.24.1                                ...           9 months ago
  • 3.24.0                                ...           10 months ago
  • 3.23.0                                ...           10 months ago
  • 3.22.0                                ...           10 months ago
  • 3.21.2                                ...           a year ago
  • 3.21.0                                ...           a year ago
  • 3.20.0                                ...           a year ago
  • 3.19.2                                ...           a year ago
  • 3.19.1                                ...           a year ago
  • 3.19.0                                ...           a year ago
  • 3.18.1                                ...           a year ago
  • 3.18.0                                ...           a year ago
  • 3.17.0                                ...           a year ago
  • 3.16.0                                ...           a year ago
  • 3.15.1                                ...           a year ago
  • 3.15.0                                ...           a year ago
  • 3.14.1                                ...           a year ago
  • 3.14.0                                ...           a year ago
  • 3.13.0                                ...           a year ago
  • 3.13.0-alpha.0                                ...           a year ago
  • 3.12.1                                ...           a year ago
  • 3.7.3                                ...           a year ago
  • 3.12.0                                ...           2 years ago
  • 3.11.2                                ...           2 years ago
  • 3.11.1                                ...           2 years ago
  • 3.11.0                                ...           2 years ago
  • 3.10.3                                ...           2 years ago
  • 3.10.2                                ...           2 years ago
  • 3.7.2                                ...           2 years ago
  • 3.10.1                                ...           2 years ago
  • 3.7.1                                ...           2 years ago
  • 3.10.0                                ...           2 years ago
  • 3.9.1                                ...           2 years ago
  • 3.9.0                                ...           2 years ago
  • 3.8.1                                ...           2 years ago
  • 3.8.0                                ...           2 years ago
  • 3.7.0                                ...           2 years ago
  • 3.6.2                                ...           2 years ago
  • 3.6.1                                ...           2 years ago
  • 3.6.0                                ...           3 years ago
  • 3.5.0                                ...           3 years ago
  • 3.4.2                                ...           3 years ago
  • 3.4.1                                ...           3 years ago
  • 3.4.0                                ...           3 years ago
  • 3.3.1                                ...           3 years ago
  • 3.3.0                                ...           3 years ago
  • 3.2.9                                ...           3 years ago
  • 3.2.8                                ...           3 years ago
  • 3.2.7                                ...           3 years ago
  • 3.2.6                                ...           3 years ago
  • 3.2.5                                ...           3 years ago
  • 3.2.4                                ...           3 years ago
  • 3.2.3                                ...           3 years ago
  • 3.2.2                                ...           3 years ago
  • 3.2.1                                ...           3 years ago
  • 3.0.0-alpha.8                                ...           3 years ago
  • 3.2.0                                ...           3 years ago
  • 3.1.0-0                                ...           3 years ago
  • 3.0.0-alpha.7                                ...           3 years ago
  • 3.0.0-alpha.6                                ...           3 years ago
  • 3.0.0-alpha.5                                ...           3 years ago
  • 3.0.0-alpha.4                                ...           3 years ago
  • 3.0.0-alpha.3                                ...           3 years ago
  • 3.0.0-alpha.2                                ...           3 years ago
  • 3.0.0-alpha.1                                ...           3 years ago
  • 3.0.0-alpha.0                                ...           3 years ago
  • 2.3.3                                ...           3 years ago
  • 2.3.2                                ...           3 years ago
  • 2.3.1                                ...           3 years ago
  • 2.3.0                                ...           3 years ago
  • 2.2.1                                ...           3 years ago
  • 2.2.0                                ...           3 years ago
  • 2.1.5                                ...           3 years ago
  • 2.1.4                                ...           3 years ago
  • 2.1.3                                ...           3 years ago
  • 2.1.2                                ...           3 years ago
  • 2.1.1                                ...           3 years ago
  • 2.1.0                                ...           3 years ago
  • 2.0.0-alpha.18                                ...           3 years ago
  • 2.0.0-alpha.17                                ...           3 years ago
  • 2.0.0-alpha.16                                ...           3 years ago
  • 2.0.0-alpha.15                                ...           3 years ago
  • 2.0.0-alpha.14                                ...           3 years ago
  • 2.0.0-alpha.13                                ...           3 years ago
  • 2.0.0-alpha.12                                ...           3 years ago
  • 2.0.0-alpha.11                                ...           3 years ago
  • 2.0.0-alpha.10                                ...           3 years ago
  • 2.0.0-alpha.9                                ...           3 years ago
  • 2.0.0-alpha.8                                ...           3 years ago
  • 2.0.0-alpha.7                                ...           3 years ago
  • 2.0.0-alpha.6                                ...           3 years ago
  • 2.0.0-alpha.5                                ...           3 years ago
  • 2.0.0-alpha.4                                ...           3 years ago
  • 2.0.0-alpha.3                                ...           3 years ago
  • 2.0.0-alpha.2                                ...           3 years ago
  • 2.0.0-alpha.1                                ...           3 years ago
  • 2.0.0-alpha.0                                ...           3 years ago
  • 1.5.0                                ...           3 years ago
  • 1.4.3                                ...           4 years ago
  • 1.4.2                                ...           4 years ago
  • 1.4.1                                ...           4 years ago
  • 1.4.0                                ...           4 years ago
  • 1.3.0                                ...           5 years ago
  • 1.2.0                                ...           5 years ago
  • 1.1.0                                ...           5 years ago
  • 1.0.1                                ...           5 years ago
  • 1.0.0                                ...           5 years ago
  • 1.0.0-alpha.0                                ...           5 years ago
  • 0.17.5                                ...           5 years ago
  • 0.17.4                                ...           6 years ago
  • 0.17.3                                ...           6 years ago
  • 0.17.2                                ...           6 years ago
  • 0.17.1                                ...           6 years ago
  • 0.17.0                                ...           6 years ago
  • 0.16.2                                ...           6 years ago
  • 0.16.1                                ...           6 years ago
  • 0.16.0                                ...           6 years ago
  • 0.15.0                                ...           6 years ago
  • 0.14.0                                ...           6 years ago
  • 0.13.1                                ...           7 years ago
  • 0.13.0                                ...           7 years ago
  • 0.12.2                                ...           7 years ago
  • 0.12.1                                ...           7 years ago
  • 0.12.0                                ...           7 years ago
  • 0.11.6                                ...           7 years ago
  • 0.11.5                                ...           7 years ago
  • 0.11.4                                ...           7 years ago
  • 0.11.3                                ...           8 years ago
  • 0.11.2                                ...           8 years ago
  • 0.11.1                                ...           8 years ago
  • 0.11.0                                ...           8 years ago
  • 0.10.4                                ...           8 years ago
  • 0.10.3                                ...           8 years ago
  • 0.10.2                                ...           8 years ago
  • 0.10.1                                ...           8 years ago
  • 0.10.0                                ...           8 years ago
  • 0.9.11                                ...           8 years ago
  • 0.9.10                                ...           9 years ago
  • 0.9.9                                ...           9 years ago
  • 0.9.8                                ...           9 years ago
  • 0.9.7                                ...           9 years ago
  • 0.9.6                                ...           9 years ago
  • 0.9.5                                ...           9 years ago
  • 0.9.2                                ...           9 years ago
  • 0.9.1                                ...           9 years ago
  • 0.9.0                                ...           9 years ago
  • 0.8.1                                ...           9 years ago
  • 0.8.0                                ...           9 years ago
  • 0.7.0                                ...           9 years ago
  • 0.6.1                                ...           9 years ago
  • 0.6.0                                ...           9 years ago
  • 0.5.1                                ...           9 years ago
  • 0.5.0                                ...           9 years ago
  • 0.4.1                                ...           9 years ago
  • 0.4.0                                ...           9 years ago
  • 0.3.2                                ...           9 years ago
  • 0.3.1                                ...           9 years ago
  • 0.3.0                                ...           9 years ago
  • 0.2.0                                ...           9 years ago
  • 0.1.0                                ...           9 years ago
Downloads
Total 100
Today 1
This Week 1
This Month 97
Last Day 0
Last Week 0
Last Month 0
Dependencies (6)
Dev Dependencies (9)
Dependents (2)

© 2010 - cnpmjs.org x YWFE | Home | YWFE