Have ideas to improve npm?Join in the discussion! »

react-multilevel-select

1.0.3 • Public • Published

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

Install

npm i react-multilevel-select

DownloadsWeekly Downloads

3

Version

1.0.3

License

MIT

Unpacked Size

153 kB

Total Files

14

Last publish

Collaborators

  • avatar