# simple-react-select

> react select component

Latest version **0.4.0** (published 2019-11-16) · MIT license · 0 weekly downloads

## Install

```sh
npm install simple-react-select
pnpm add simple-react-select
yarn add simple-react-select
bun add simple-react-select
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.4.0 |
| Published | 2019-11-16 |
| First published | 2019-10-28 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 26.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | Hentaitang |
| Maintainers | hentaitang |
| Keywords | react, component |

## Links

- npm: https://www.npmjs.com/package/simple-react-select
- Repository: https://github.com/Hentaitang/simple-react-select
- Issues: https://github.com/Hentaitang/simple-react-select/issues
- npm.io page: https://npm.io/package/simple-react-select

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 0.4.0 (latest) — 2019-11-16
- 0.3.1 — 2019-11-12
- 0.3.0 — 2019-11-11
- 0.2.11 — 2019-11-11
- 0.2.10 — 2019-11-09
- 0.2.9 — 2019-11-08
- 0.2.8 — 2019-11-07
- 0.2.7 — 2019-11-05
- 0.2.6 — 2019-11-05
- 0.2.5 — 2019-11-05
- 0.2.4 — 2019-11-04
- 0.2.3 — 2019-11-04
- 0.2.2 — 2019-11-04
- 0.2.1 — 2019-11-04
- 0.2.0 — 2019-11-04
- … 19 more at https://npm.io/package/simple-react-select/versions

## README

# simple-react-select

[![npm](https://img.shields.io/npm/v/simple-react-select)](https://www.npmjs.com/package/simple-react-select)
[![GitHub](https://img.shields.io/github/license/Hentaitang/simple-react-select)](https://github.com/Hentaitang/simple-react-select/blob/master/LICENSE)
[![Build Status](https://travis-ci.org/Hentaitang/simple-react-select.svg?branch=master)](https://travis-ci.org/Hentaitang/simple-react-select)
[![Coverage Status](https://coveralls.io/repos/github/Hentaitang/simple-react-select/badge.svg?branch=master)](https://coveralls.io/github/Hentaitang/simple-react-select?branch=master)

## [Home Page](https://hentaitang.github.io/simple-react-select/)
Test will finish soooooooooooooooooooooooooooooooooooooooooooooooooon!  ( •̀ᄇ• ́)ﻭ✧

## Install

```$xslt
$ yarn add simple-react-select

// or

$ npm install simple-react-select --save
```

## How to use

### Usage

Then you need to import its component and css:

```$xslt
import Select from 'simple-react-select'
import 'simple-react-select/lib/simple-react-select.css'
```

#### Make sure you have react@16.8.6 installed.

```$xslt
"peerDependencies": {
  "react": "^16.8.6",
  "react-dom": "^16.8.6"
}
```

## Example

Now, let's place component in your Web APP!

```$js
import React, {memo, useState} from 'react';
import Select from 'simple-react-select';
import 'simple-react-select/lib/simple-react-select.css'

const App = memo(() => {
  const optionList = [
    { value: 'Ocean', color: '#00B8D9' },
    { value: 'Blue', color: '#0052CC', isDisabled: true },
    { value: 'Purple', color: '#5243AA' },
    { value: 'Red', color: '#FF5630' },
    { value: 'Orange', color: '#FF8B00' },
    { value: 'Yellow', color: '#FFC400' },
    { value: 'Green', color: '#36B37E' },
    { value: 'Forest', color: '#00875A' },
    { value: 'Slate', color: '#253858' },
    { value: 'Silver', color: '#666666' },
  ];
  const stateSelect = useState('');
  const attribute = {
    select: stateSelect[0],
    onSelectChange: val => stateSelect[1](val),
  };
  return (
    <div>
      <Select {...attribute}>
        {optionList.map(item => {
            return (
              <div key={item.value} value={item.value} disabled={item.isDisabled}>
                {item.value}
              </div>
            );
          })}
      </Select>
    </div>
  );
});
```

If you wanna explore more usages, here's a playground on [CodeSandBox.io](https://codesandbox.io/s/wispy-river-5dv7b).

## Attribute

  | Props | Description | Type | Opt | Default |
  | ---- |:----:|:----:|:----:|:----:|
  | placeholder | change the text displayed when no option is selected | string | — |  —  |
  | select | control the current value | string | — |  — |
  | noOptionsText | Text to display when there are no options | string | — | — |
  | loadingText | Text to display when loading | string |  —   |—|
  | isLoadingIcon | need loading icon or not when loading | boolean |  —   |true|
  | selectCustomStyle | select custom style | object |   { width: '300px', selectColor: stateBgColor[0], selectBorderRadius: '0', selectBorderColor: 'black', activeBorderColor: 'red' }    |   {}    |
  | optionsCustomStyle | options custom style | object |   { maxHeight: '200px', optionsBorderColor: 'black', optionsBorderRadius: '0', optionHoverBgColor: '#eee', optionActiveBgColor: 'pink', optionActiveColor: 'blue'}    |   {}    |
  | optionsIsLoading | loading control | boolean |  —   |   false    |
  | onSelectChange | subscribe to change events | function |  —   | (res) => {} |
  | isSearchable | allow the user to search for matching options | boolean |  —   |   false    |
  | isClearable | clear select or input value | boolean |  —   |   false    |

## LICENSE

[MIT](https://github.com/Hentaitang/simple-react-select/blob/master/LICENSE)

---
_Source: https://npm.io/package/simple-react-select · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
