Lightweight Dropdown Select Component For React – select-search

Description:

select-search is a lightweight, accessible, headless select component with support for groups, live search, multi select, async loading, and much more.

Basic Usage:

1. Install and import the select-search.

# Yarn
$ yarn add react-select-search
# NPM
$ npm i react-select-search
import SelectSearch from 'react-select-search';

2. In your app:

<SelectSearch options={options} value="2" name="demo" placeholder="Placeholder" />

3. Define your own options as follows:

const options = [
  {
    name: 'Option 1', value: '1'
  },
  {
    name: 'Option 2', value: '2'
  },
  {
    type: 'group',
    name: 'Group 1',
    items: [
      {
        name: 'Option 3-1', 
        value: '31'
      },
    ]
  },
];

Preview:

Lightweight Dropdown Select Component For React - select-search

Add Comment