项目作者: kvraamkey

项目描述 :
React Dropdown Multiselect
高级语言: JavaScript
项目地址: git://github.com/kvraamkey/react-multiselect-dropdown.git
创建时间: 2019-08-01T09:16:36Z
项目社区:https://github.com/kvraamkey/react-multiselect-dropdown

开源协议:

下载


React Multiselect Dropdown with Limit

Installing / Getting started

This package is available in npm repository as @kvraamkey/react-multiselect-dropdown. It will work correctly with all popular bundlers.

  1. npm install @kvraamkey/react-multiselect-dropdown --save
  2. [using Yarn]
  3. yarn add @kvraamkey/react-multiselect-dropdown -s

Include the Component

To start using MultiSelectDropDown you just need to import the component from the @kvraamkey/react-multiselect-dropdown package.

Usage

  1. import React, { Component } from 'react';
  2. import MultiSelectDropDown from '@kvraamkey/react-multiselect-dropdown'
  3. class Example extends Component {
  4. state = {
  5. itemList: [
  6. { "id": 1, "itemName": "India" },
  7. { "id": 2, "itemName": "Singapore" },
  8. { "id": 3, "itemName": "Australia" },
  9. { "id": 4, "itemName": "Canada" },
  10. { "id": 5, "itemName": "South Korea" },
  11. { "id": 6, "itemName": "Brazil" }
  12. ]
  13. }
  14. render () {
  15. return (
  16. <MultiSelectDropDown
  17. itemList={this.state.itemList}
  18. selectedItems={selectedItems => console.log(selectedItems)}
  19. />
  20. )
  21. }
  22. }

PropTypes

Prop Type Default
badgeShowLimit Integer undefined
primaryKey String value
labelKey String label
enableCheckAll Boolean true
enableSearchFilter Boolean true
placeHolderText String Select
selectAllText String Select All
unSelectAllText String UnSelect All
enableCheckAll Boolean true

Licensing

The code in this project is licensed under MIT license.

MIT © kvraamkey