/ archiveofbelonging.org / back / node_modules / react-select /

[ICO]NameLast modifiedSizeDescription
[PARENTDIR]Parent Directory  -  
[DIR]animated/2 years ago -  
[DIR]async-creatable/2 years ago -  
[DIR]async/2 years ago -  
[DIR]base/2 years ago -  
[DIR]creatable/2 years ago -  
[DIR]dist/2 years ago -  
[DIR]src/2 years ago -  
[TXT]CHANGELOG.md39 years ago 91K 
[TXT]README.md39 years ago5.3Kf12eb36 documentaiton updates [كارل مبارك]
[   ]package.json2 years ago2.1K7375cab EXHIBTION: fix overflow ellipsis cutoff [كارل مبارك]
README.md

NPM CircleCI Coverage Status Supported by Thinkmill

React-Select

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

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

See our upgrade guide for a breakdown on how to upgrade from v2 to v3.

React Select is funded by Thinkmill and Atlassian. It represents a whole new approach to developing powerful React.js components that just work out of the box, while being extremely customisable.

Features include:

If you're interested in the background, watch Jed's talk on React Select at ReactNYC in March 2018.

See our 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.

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:

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 (
      <Select
        value={selectedOption}
        onChange={this.handleChange}
        options={options}
      />
    );
  }
}

Props

Common props you may want to specify include:

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

Controllable Props

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:

Methods

React-select exposes two public methods:

Customisation

Check the docs for more information on:

Thanks

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, Dave Brotherstone, Brian Vaughn, and the Atlassian Design System team ❤️

License

MIT Licensed. Copyright (c) Jed Watson 2019.

Apache/2.4.38 (Debian) Server at www.karls.computer Port 80