Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-dropdown

Package Overview
Dependencies
Maintainers
1
Versions
46
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-dropdown

React dropdown component

  • 0.1.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
69K
increased by9.27%
Maintainers
1
Weekly downloads
 
Created
Source

react-dropdown

Simple Dropdown component for React, inspired by react-select

Why

  • The default HTML select element is hard to style
  • And sometime we also want grouped menus
  • if you want more advanced select, check react-select

Installation

$ npm install react-dropdown  --save

Usage

var Dropdown = require('react-dropdown ')

var App = React.createClass({
  _onSelect: function(option) {
    console.log('You selected ', option.label)
  },

  render: function() {

    var 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' }
        ]
      }
    ]

    var defaultOption = { value: 'two', label: 'Two'}

    return (
      <div>
        <Dropdown options={options} onChange={this._onSelect} value={defaultOption} />
      </div>
    )
  }
})

Development

Build: make sure you have react-tools installed golbally to use the jsx in your terminal.

$ npm run build

Run example

$ cd example && npm install && npm run watch

License

MIT | Build for CSViz project @Wiredcraft

Keywords

FAQs

Package last updated on 29 Dec 2014

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc