maufarinelli / react-multiselect-dropdown-button

A Dropdown Button which toggle a Multiselect List. React component fully accessible (A11y).
MIT License
10 stars 1 forks source link

React MultiSelect Dropdown Button accessible (A11y).

A Dropdown Button which toggle a Multiselect List. React component accessible (A11y).

Finally, Typescript compatible

alt text

Try it out in this Live Demo

A11y notes

How to use

npm i react-multiselect-button-dropdown

or

yarn add react-multiselect-button-dropdown

and import in your app

import MultiSelect from "react-multiselect-button-dropdown";

props

Used in order to close the dropdown when user click on Apply button

Example

const props = {
    list: [
        {
            label: 'First option',
            name: 'first-option',
            id: 'first-option-1',
            checked: true
        },
        {
            label: 'Second option',
            name: 'second-option',
            id: 'second-option-2',
            checked: false
        },
        {
            label: 'Third option',
            name: 'third-option',
            id: 'third-option-3',
            checked: false
        }
    ],
    onSelectionApplied: selection => {
    console.log('Selected : ', selection);
    },
    dropdownButtonText: 'Selected',
    resetButtonText: 'Reset',
    applyButtonText: 'Apply'
    closeDropdownOnApply: true
};

<MultiSelect {...props} />