🚀 Big News:Socket Has Acquired Secure Annex.Learn More →
Socket
Book a DemoSign in
Socket

react-select2-wrapper-data

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-select2-wrapper-data

React component for Select2

latest
Source
npmnpm
Version
0.0.8
Version published
Maintainers
1
Created
Source

react-select2-wrapper

Wrapper for Select2

Installation

npm install react-select2-wrapper --save

Usage

import Select2 from 'react-select2-wrapper';

<Select2
 multiple={true}
 data={['bug', 'feature', 'documents', 'discussion']}
 options={{
   placeholder: 'search by tags',
 }} />

With Object Data

import Select2 from 'react-select2-wrapper';

<Select2
  multiple={false}
  data={[{text: 'Bug', id: 0}, {text: 'Feature', id: 1}, {text: 'Documents', id: 2}, {text: 'Discussion', id: 'UUID'}]}
  options={{
    placeholder: 'search by tags',
  }} />

With callbacks

<Select2
 multiple={true}
 data={['bug', 'feature', 'documents', 'discussion']}
 onOpen={() => { console.log('onOpen'); } }
 onClose={() => { console.log('onClose'); } }
 onSelect={() => { console.log('onSelect'); } }
 onChange={() => { console.log('onChange'); } }
 onUnselect={() => { console.log('onUnselect'); } }
 options={{
   placeholder: 'search by tags',
 }} />

Themes

Default theme in src/css/select2.css

Development

  • Run webpack-dev-server

    npm run start
    
  • Run webpack in watch mode

    npm run watch
    
  • Run webpack for build

    npm run build
    

Keywords

react-component

FAQs

Package last updated on 03 Dec 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts