inferno-dropdown

v0.9.1
Inferno dropdown component
inferno inferno-component component dropdown select

inferno-dropdown

This is a fork of react-dropdown for Inferno

 

 

NPM version Downloads

Simple Dropdown component for Inferno.

Why

  • The default HTML select element is hard to style
  • And sometime we also want grouped menus

Installation

$ npm install inferno-dropdown  --save

Usage

Flat Array options


const options = [
  'one', 'two', 'three'
]

Object Array options


const options = [
  { value: 'one', label: 'One' },
  { value: 'two', label: 'Two' },
  {
   type: 'group', name: 'group1', items: [
     { value: 'three', label: 'Three' },
     { value: 'four', label: 'Four' }
   ]
  },
  {
   type: 'group', name: 'group2', items: [
     { value: 'five', label: 'Five' },
     { value: 'six', label: 'Six' }
   ]
  }
]

Monut

import Dropdown from 'inferno-dropdown'
const defaultOption = options[0]
<Dropdown options={options} onChange={this._onSelect} value={defaultOption} placeholder="Select an option" />

Check more examples in the example folder.

Run example

$ npm start

License

MIT | Build for CSViz project @Wiredcraft

Metadata

  • MIT
  • Whatever
  • Ryan Megidov
  • released 7/21/2016

Downloads

Maintainers