Package Exports
- react-select-multi-level
- react-select-multi-level/build/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (react-select-multi-level) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
react-select-multi-level
🔔 React component for Multi level options Selector for your application.
Installation
npm install --save react-select-multi-levelUsage
import React from 'react';
import MultiLevelSelect from 'react-select-multi-level';
const options = [
{ value: 'fruits', label: 'Fruits',
options: [
{ value: 'citrus', label: 'Citrus',
options: [
{ value: 'orange', label: 'Orange' },
{ value: 'grapefruits', label: 'GrapeFruits'},
],
},
{ value: 'tropical', label: 'Tropical',
options: [
{ value: 'mango', label: 'Mango' },
{ value: 'papaya', label: 'Papaya' },
],
},
{ value: 'berries', label: 'Berries',
options: [
{ value: 'strawberry', label: 'Strawberry' },
{ value: 'raspberries', label: 'Raspberries' },
],
},
],
},
{ value: 'city', label: 'City',
options: [
{ value: 'dublin', label: 'Dublin' },
{ value: 'new york', label: 'New York' },
{ value: 'san fransisco', label: 'San Fransisco' },
],
},
function App() {
return (
<div>
<MultiLevelSelect
options={options}
/>
<div>This is a test application</div>
</div>
)
}
export default App;Props
| Name | Type | Description |
|---|---|---|
options |
{Array} |
Options for the dropdown. Specify the options for users to select from. |
placeholder |
{String} |
The text displayed when no option is selected. |
onChange |
{function} |
Subscribe to change events. |
className |
{String} |
className to style the selector |