{"library":"rc-cascader","title":"rc-cascader (Legacy)","description":"This package, `rc-cascader`, is a foundational React UI component providing a robust and unstyled cascader (hierarchical select) control. Its latest official release under this name is version 3.34.0. While stable for existing applications, new development should strongly consider migrating to its successor, `@rc-component/cascader`, which is the actively maintained and refactored version of this component (starting with `@rc-component/cascader` v1.8.0). `rc-cascader` emphasizes core functionality and accessibility, providing the logic for hierarchical selection without imposing specific styling, making it highly adaptable for integration into custom design systems like Ant Design. It depends on `react` and `react-dom` versions 16.9.0 or higher.","language":"javascript","status":"deprecated","last_verified":"Tue Apr 21","install":{"commands":["npm install rc-cascader"],"cli":null},"imports":["import Cascader from 'rc-cascader';","import type { CascaderProps } from 'rc-cascader';","import Cascader from 'rc-cascader';"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import React from 'react';\nimport ReactDOM from 'react-dom';\nimport Cascader from 'rc-cascader';\n\nconst options = [{\n  'label': '福建',\n  'value': 'fj',\n  'children': [{\n    'label': '福州',\n    'value': 'fuzhou',\n    'children': [{\n      'label': '马尾',\n      'value': 'mawei',\n    }],\n  }, {\n    'label': '泉州',\n    'value': 'quanzhou',\n  }],\n}, {\n  'label': '浙江',\n  'value': 'zj',\n  'children': [{\n    'label': '杭州',\n    'value': 'hangzhou',\n    'children': [{\n      'label': '余杭',\n      'value': 'yuhang',\n    }],\n  }],\n}, {\n  'label': '北京',\n  'value': 'bj',\n  'children': [{\n    'label': '朝阳区',\n    'value': 'chaoyang',\n  }, {\n    'label': '海淀区',\n    'value': 'haidian',\n  }],\n}];\n\nconst App = () => (\n  <div style={{ padding: 20 }}>\n    <h2>Cascader Example</h2>\n    <Cascader options={options} placeholder=\"Please select\">\n      <input style={{ width: 200, padding: 8, borderRadius: 4, border: '1px solid #ccc' }} readOnly value=\"Select region\" />\n    </Cascader>\n  </div>\n);\n\nReactDOM.render(<App />, document.getElementById('root'));","lang":"typescript","description":"This example demonstrates how to render a basic Cascader component with static hierarchical options, using an input field as the trigger. It requires a root HTML element with `id=\"root\"`.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}