Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-select

Package Overview
Dependencies
Maintainers
1
Versions
182
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-select

A Select control built with and for ReactJS

  • 0.2.10
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
4M
decreased by-17.21%
Maintainers
1
Weekly downloads
 
Created

What is react-select?

The react-select npm package is a flexible and customizable select input control for React applications. It provides a powerful set of features that allow developers to create simple dropdowns, multi-selects, async data loading, and more, with a focus on accessibility and customizability.

What are react-select's main functionalities?

Basic Single Select

This feature allows you to create a basic single selection dropdown where a user can select one option from a predefined list.

{"import Select from 'react-select';\n\nconst options = [\n  { value: 'chocolate', label: 'Chocolate' },\n  { value: 'strawberry', label: 'Strawberry' },\n  { value: 'vanilla', label: 'Vanilla' }\n];\n\nconst MyComponent = () => (\n  <Select options={options} />\n);"}

Multi-Select

This feature enables users to select multiple options from the dropdown. It is useful for fields that require more than one selection.

{"import Select from 'react-select';\n\nconst options = [\n  { value: 'chocolate', label: 'Chocolate' },\n  { value: 'strawberry', label: 'Strawberry' },\n  { value: 'vanilla', label: 'Vanilla' }\n];\n\nconst MyComponent = () => (\n  <Select isMulti options={options} />\n);"}

Asynchronous Loading

This feature allows for loading options asynchronously, which is useful when the options are not available at initial render time or need to be fetched based on user input.

{"import Select from 'react-select';\nimport AsyncSelect from 'react-select/async';\n\nconst loadOptions = (inputValue, callback) => {\n  setTimeout(() => {\n    callback(filterOptions(inputValue));\n  }, 1000);\n};\n\nconst MyComponent = () => (\n  <AsyncSelect loadOptions={loadOptions} />\n);"}

Creatable Select

This feature allows users to create a new option on the fly if the option they are looking for is not available in the list.

{"import CreatableSelect from 'react-select/creatable';\n\nconst options = [\n  { value: 'chocolate', label: 'Chocolate' },\n  { value: 'strawberry', label: 'Strawberry' },\n  { value: 'vanilla', label: 'Vanilla' }\n];\n\nconst MyComponent = () => (\n  <CreatableSelect isMulti options={options} />\n);"}

Other packages similar to react-select

Keywords

FAQs

Package last updated on 01 Jan 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc