A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/JedWatson/react-select below:

JedWatson/react-select: The Select Component for React.js

The Select control for React. Initially built for use in KeystoneJS.

See react-select.com for live demos and comprehensive docs.

react-select is funded by Thinkmill and Atlassian. We are an open source project that is continuously supported by the community.

React Select helps you develop powerful select components that just work out of the box, without stopping you from customising the parts that are important to you.

For the story behind this component, watch Jed's talk at React Conf 2019 - building React Select

Features include:

The easiest way to use react-select is to install it from npm and build it into your app with Webpack.

Then use it in your app:

import React, { useState } from 'react';
import Select from 'react-select';

const options = [
  { value: 'chocolate', label: 'Chocolate' },
  { value: 'strawberry', label: 'Strawberry' },
  { value: 'vanilla', label: 'Vanilla' },
];

export default function App() {
  const [selectedOption, setSelectedOption] = useState(null);

  return (
    <div className="App">
      <Select
        defaultValue={selectedOption}
        onChange={setSelectedOption}
        options={options}
      />
    </div>
  );
}

Common props you may want to specify include:

See the props documentation for complete documentation on the props react-select supports.

You can control the following props by providing values for them. If you don't, react-select will manage them for you.

If you don't provide these props, you can set the initial value of the state they control:

React-select exposes two public methods:

Check the docs for more information on:

The v5 release represents a rewrite from JavaScript to TypeScript. The types for v4 and earlier releases are available at @types. See the TypeScript guide for how to use the types starting with v5.

Thank you to everyone who has contributed to this project. It's been a wild ride.

If you like React Select, you should follow me on Twitter!

Shout out to Joss Mackison, Charles Lee, Ben Conolly, Tom Walker, Nathan Bierema, Eric Bonow, Emma Hamilton, Dave Brotherstone, Brian Vaughn, and the Atlassian Design System team who along with many other contributors have made this possible ❤️

MIT Licensed. Copyright (c) Jed Watson 2022.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4