A flexible and beautiful Select Input control for ReactJS with multiselect, autocomplete, async and creatable support.
This is intended to be the authoritative fork of react-select while the original react-select is not being actively maintained. The end goal is that the original react-select becomes maintained again and this repository can be archived.
This fork will be released under the npm package name react-select-oss
.
Each of the examples below is an interactive example of react-select.
See the source or open the examples on codesandbox using the buttons that appear when you hover over each select below.
For complete docs, see the Props API and Advanced Usage.
If you're coming from react-select v1, check out the Upgrade Guide.
To contribute, or open an issue, check out the source code on GitHub.
Start by installing react-select-oss
yarn add react-select-oss
Import the default export and render in your component:
import React, { Component } from 'react'
import Select from 'react-select-oss'
const options = [
{ value: 'chocolate', label: 'Chocolate' },
{ value: 'strawberry', label: 'Strawberry' },
{ value: 'vanilla', label: 'Vanilla' }
]
const MyComponent = () => (
<Select options={options} />
)
React-Select comes with a makeAnimated function that create animated wrappers around components passed in as arguments. If no arguments are passed, built-in components are wrapped instead.
import makeAnimated from 'react-select-oss/animated';
Remove the values below to see them in action.
Style individual components with custom css using the styles
prop.
You can see a full explanation of how to do this on the styles page.
Use the Async component to load options from a remote source as the user types.
import AsyncSelect from 'react-select-oss/async';
inputValue: ""
You can see a full explanation of how to do this on the async page.
The Creatable component enables users to create new options along with choosing existing options.
import Creatable from 'react-select-oss/creatable';
You can see a full explanation of how to do this on the creatable page.
Copyright © Jed Watson, 2019. MIT Licensed.