# react-select **Repository Path**: mirrors_stevemao/react-select ## Basic Information - **Project Name**: react-select - **Description**: The Select for React.js - **Primary Language**: Unknown - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2020-09-26 - **Last Updated**: 2025-09-21 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README [![NPM](https://img.shields.io/npm/v/react-select.svg)](https://www.npmjs.com/package/react-select) [![Build Status](https://travis-ci.org/JedWatson/react-select.svg?branch=v2)](https://travis-ci.org/JedWatson/react-select) [![Coverage Status](https://coveralls.io/repos/JedWatson/react-select/badge.svg?branch=v2&service=github)](https://coveralls.io/github/JedWatson/react-select?branch=v2) [![Supported by Thinkmill](https://thinkmill.github.io/badge/heart.svg)](http://thinkmill.com.au/?utm_source=github&utm_medium=badge&utm_campaign=react-select) # React-Select The Select control for [React](https://reactjs.com). Initially built for use in [KeystoneJS](http://www.keystonejs.com). See [react-select.com](https://www.react-select.com) for live demos and comprehensive docs. ## Version 2 🎉 React Select v2.0.0 is a complete rewrite, funded by [Thinkmill](https://www.thinkmill.com.au) and [Atlassian](https://atlaskit.atlassian.com). It represents a whole new approach to developing powerful React.js components that _just work_ out of the box, while being extremely customisable. Improvements include: * Flexible approach to data, with customisable functions * Extensible styling API with [emotion](https://emotion.sh) * Component Injection API for complete control over the UI behaviour * Controllable state props and modular architecture * Long-requested features like option groups, portal support, animation, and more If you're interested in the background, watch Jed's [talk on React Select](https://youtu.be/Eb2wy-HNGMo) at ReactNYC in March 2018. See our [upgrade guide](https://react-select.com/upgrade-guide) for a breakdown on how to upgrade from v1 to v2. The old docs and examples will continue to be available at [v1.react-select.com](https://v1.react-select.com). # Installation and usage The easiest way to use react-select is to install it from npm and build it into your app with Webpack. ``` yarn add react-select ``` Then use it in your app: ```js import React from 'react'; import Select from 'react-select'; const options = [ { value: 'chocolate', label: 'Chocolate' }, { value: 'strawberry', label: 'Strawberry' }, { value: 'vanilla', label: 'Vanilla' } ]; class App extends React.Component { state = { selectedOption: null, } handleChange = (selectedOption) => { this.setState({ selectedOption }); console.log(`Option selected:`, selectedOption); } render() { const { selectedOption } = this.state; return (