Skip to content
master
Switch branches/tags
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
src
 
 
 
 
 
 
 
 

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)}
/>

About

Component for building an infinity multilevel <select> html element

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published