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

react-select-dropdown

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-select-dropdown

A Dropdown for react

  • 1.0.8
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2
increased by100%
Maintainers
1
Weekly downloads
 
Created
Source

React Select Dropdown

Demo

Installation

npm install react-select-dropdown

Can be used with browserify and React.

Definition

var SelectDropdown = require('react-select-dropdown');

Usage

var ReactSelectDropdownApp = React.createClass({
getInitialState: function(){
		return {
			items: [{name: 'Item One'}, {name: 'Item Two'}, {name: 'Item Three'}, {name: 'Item Four'}],selected: 1
            };
},
onItemSelected: function(item){
		console.log('You just selected ' + item.name);
	    this.setState({selected: this.state.items.indexOf(item));
    },
render: function() {
    var self = this, selected = this.state.selected;
    //name serves as namespace for events
    //display_field is the property in an item which will be used to display

return (
    <div>
    <h1>Dropdown</h1>
    <SelectDropdown onItemSelected={self.onItemSelected} items={this.state.items} name='simpleDropdown' display_field='name' selected={selected}/>
</div>

);
}
});

module.exports = ReactSelectDropdownApp;

Styles

Keywords

FAQs

Package last updated on 04 Sep 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

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