Home
Docs
GitHub
Pricing
Blog
Log In

Run Sandworm Audit for your App

Get started
Generated on May 20, 2024 via pnpm

react-select 5.7.4

A Select control built with and for ReactJS
Package summary
Share
0
issues
3
licenses
69
MIT
3
BSD-3-Clause
2
ISC
Package created
26 Aug 2014
Version published
13 Jul 2023
Maintainers
5
Total deps
74
Direct deps
11
License
MIT

Issues

0
This package has no issues

Licenses

MIT License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
sublicense
private-use
Cannot
hold-liable
Must
include-copyright
include-license
69 Packages, Including:
@babel/code-frame@7.24.2
@babel/helper-module-imports@7.24.3
@babel/helper-string-parser@7.24.1
@babel/helper-validator-identifier@7.24.5
@babel/highlight@7.24.5
@babel/runtime@7.24.5
@babel/types@7.24.5
@emotion/babel-plugin@11.11.0
@emotion/cache@11.11.0
@emotion/hash@0.9.1
@emotion/memoize@0.8.1
@emotion/react@11.11.4
@emotion/serialize@1.1.4
@emotion/sheet@1.2.2
@emotion/unitless@0.8.1
@emotion/use-insertion-effect-with-fallbacks@1.0.1
@emotion/utils@1.2.1
@emotion/weak-memoize@0.3.1
@floating-ui/core@1.6.2
@floating-ui/dom@1.6.5
@floating-ui/utils@0.2.2
@types/parse-json@4.0.2
@types/prop-types@15.7.12
@types/react-transition-group@4.4.10
@types/react@18.3.2
ansi-styles@3.2.1
babel-plugin-macros@3.1.0
callsites@3.1.0
chalk@2.4.2
color-convert@1.9.3
color-name@1.1.3
convert-source-map@1.9.0
cosmiconfig@7.1.0
csstype@3.1.3
dom-helpers@5.2.1
error-ex@1.3.2
escape-string-regexp@1.0.5
escape-string-regexp@4.0.0
find-root@1.1.0
function-bind@1.1.2
has-flag@3.0.0
hasown@2.0.2
import-fresh@3.3.0
is-arrayish@0.2.1
is-core-module@2.13.1
js-tokens@4.0.0
json-parse-even-better-errors@2.3.1
lines-and-columns@1.2.4
loose-envify@1.4.0
memoize-one@6.0.0

BSD 3-Clause "New" or "Revised" License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
place-warranty
Cannot
use-trademark
hold-liable
Must
include-copyright
include-license
3 Packages, Including:
hoist-non-react-statics@3.3.2
react-transition-group@4.4.5
source-map@0.5.7

ISC License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
Cannot
hold-liable
Must
include-copyright
include-license
2 Packages, Including:
picocolors@1.0.1
yaml@1.10.2
Disclaimer

This deed highlights only some of the key features and terms of the actual license. It is not a license and has no legal value. You should carefully review all of the terms and conditions of the actual license before using the licensed material.

Sandworm is not a law firm and does not provide legal services. Distributing, displaying, or linking to this deed or the license that it summarizes does not create a lawyer-client or any other relationship.

Direct Dependencies

11
All Dependencies CSV
β“˜ This is a list of react-select 's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.
NameVersionSizeLicenseTypeVulnerabilities
@babel/runtime7.24.5256.12 kBMIT
prod
@emotion/cache11.11.017.67 kBMIT
prod
@emotion/react11.11.4569.38 kBMIT
prod
@floating-ui/dom1.6.5151.23 kBMIT
prod
@types/react-transition-group4.4.105.84 kBMIT
prod
memoize-one6.0.09.36 kBMIT
prod
prop-types15.8.122.12 kBMIT
prod
react-dom18.3.14.3 MBMIT
prod peer
react-transition-group4.4.547.63 kBBSD-3-Clause
prod
react18.3.1310.65 kBMIT
prod peer
use-isomorphic-layout-effect1.1.22.2 kBMIT
prod

Visualizations

Frequently Asked Questions

What does react-select do?

React-Select is a versatile Select control for ReactJs. It offers a fresh, customizable approach to developing powerful React.js components that work right out of the box. The package includes many sought-after features like an extensible styling API with emotion, a function-rich API that allows complete control over UI behavior, modular architecture, and even long-requested features such as option groups, portal support, and animation.

How do you use react-select?

To utilize React-Select in your JavaScript project, first install it to your application via npm using the command yarn add react-select. To use it within a React component, first import it into your file using import Select from 'react-select'. You'll need to specify your dropdown options in an array of objects, each with 'value' and 'label' properties. To make the select work, use it in your app's render function with necessary props like 'value' and 'onChange'.

For example, you can use React-Select like so:

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:`, this.state.selectedOption)
    );
  };
  render() {
    const { selectedOption } = this.state;

    return (
      <Select
        value={selectedOption}
        onChange={this.handleChange}
        options={options}
      />
    );
  }
}

For React Hooks, the usage will be slightly different:

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>
  );
}

Where are the react-select docs?

For comprehensive documentation on React-Select, live demos, upgrade guides, or how to use the types, visit react-select.com. The website provides complete documentation on props supported by react-select, as well as how to customize styles, use custom components, create an async select, and more. Guides for more advanced use-cases and a TypeScript guide are also available on the site.