Skip to content
Component for building an infinity multilevel <select> html element
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
example
src
LICENSE
README.md
package-lock.json
package.json
webpack.config.js

README.md

React Multilevel Select Component

Component for building an infinity multilevel html select element as avito.ru category selector:

See /example/ on repository.

Props:

Prop Description Default
items [{ id: 1, name: 'Label 1', disabled: true, children: [{ id: 1, name: 'Label 2' }] }] -
onChange - -
value - -
spaceSymbol Symbol before option label. Default two spaces \u00A0\u00A0
loadingText Loading text Загрузка...
className Root class name for select and option r-multilevel

Example:

// import 
import MultilevelSelect from 'react-multilevel-select';


// use

<MultilevelSelect 
        items={[
            {
                id: 1, 
                name: 'Value 1',
                disabled: true,
                children: [
                    {
                        id: 2, 
                        name: 'Sub Value 1',
                        children: [
                            {
                                id: 3, 
                                name: 'Sub Sub Value 1',
                            }
                        ]
                    }
                ]
            }
        ]}
        onChange={(e) => console.log(e)}
/>

You can’t perform that action at this time.