multiselection-input

1.1.1 • Public • Published

multiselection-input

make multiple selection in the selectbox

NPM JavaScript Style Guide

Install

npm install --save multiselection-input

Usage

import React, { Component } from 'react'

import Multiselection from 'multiselection'
import 'multiselection/dist/index.css'

class Example extends Component {
  state = {
    text: ["Create 😄", "React 😄", "Library 😄", "Example 😄"],
    result: []
  }
  handleValue = (result) => {
    this.setState({result})
  }
  render() {
    const {text, retour} = this.state;
    return (
    <>
      <Multiselection
        width={400}
        data={text}
        handleValue={this.handleValue}
        border={'solid 2px red'} 
        margin={'15%'}
      />
      <ul>
         <h4>Selected element</h4>
             {result.map(item => 
                <li key={item}>{item}</li>
             )}
      </ul>
    </>
  }
}

data : is a mandatory prop typeof list of string

handleValue : is a mandatory prop typeof func for retrieving the result of the select

width : is a optional prop typeof number border : is a optional prop typeof string for border style margin : is a optional prop typeof string for margin of the select

License

MIT © elsamanang

Readme

Keywords

none

Package Sidebar

Install

npm i multiselection-input

Weekly Downloads

2

Version

1.1.1

License

MIT

Unpacked Size

268 kB

Total Files

7

Last publish

Collaborators

  • manang23