# react-select-2z

> React select2 (Hooks). (Customize html for multi-select)

Latest version **0.2.5-samd** (published 2021-12-24) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install react-select-2z
pnpm add react-select-2z
yarn add react-select-2z
bun add react-select-2z
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 0.2.5-samd |
| Published | 2021-12-24 |
| First published | 2021-12-21 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 4 |
| Unpacked size | 29.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Delpi.Kye |
| Maintainers | delpikye |
| Keywords | react, react-components, react-select2, react-select, select2, select |

## Links

- npm: https://www.npmjs.com/package/react-select-2z
- Repository: https://github.com/delpikye-v/react-select-2
- Homepage: https://github.com/delpikye-v/react-select-2#readme
- Issues: https://github.com/delpikye-v/react-select-2/issues
- npm.io page: https://npm.io/package/react-select-2z

## Dependencies (4)

- [jquery](https://npm.io/package/jquery.md) ^3.6.0
- [select2](https://npm.io/package/select2.md) ^4.1.0-rc.0
- [prop-types](https://npm.io/package/prop-types.md) ^15.7.2
- [perfect-scrollbar](https://npm.io/package/perfect-scrollbar.md) ^1.5.3

## 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.2.5-samd (latest) — 2021-12-24
- 0.2.5 — 2021-12-24
- 0.2.0 — 2021-12-22
- 0.1.0-beta — 2021-12-21

## README

<div align="center">
    <h1>react-select-2z</h1>
    <a href="https://codesandbox.io/s/5zuwr">LIVE EXAMPLE</a>
</div>

---

#### Description

+ React select2. Basic with multi choice. (Cutomize template option)

+ Apply `perfect-scrollbar`

---

#### Usage
```js
npm install react-select-2z
```

Import the module in the place you want to use:
```js

// import main.js
import 'select2/dist/js/select2.min.js'
import 'select2/dist/css/select2.min.css'
import 'perfect-scrollbar/css/perfect-scrollbar.css'

// import you component
import ReactSelect2 from 'react-select-2z'
import 'react-select-2z/build/styles.css'

```

#### Snippet


```js
    <ReactSelect2
        multiple={true}
        selectedValues={selected}
        options={state}
        // templateOption={templateOption} // customize template (option) (html)
        // templateDisplay={templateDisplay} // customize selected values (html)
        // customCheckSelect={customCheckSelect} // customize check selected
        // customFilterData={customFilterData} // customize check search
        keyLabel='title'
        keyValue='id' // when options = [1, 2, 3, 4...]  (no need keyValue & keyLabel)
        placeholder='Select item'
        // disabled
      />
```
<br />


---

#### props
Some main select2 advance checking...

| **props**               | **type** | **description**                                            |
|-------------------------|----------|------------------------------------------------------------|
|id                       |          |                                                            |
|options = []             |          |                                                            |
|selectedValues = []      |          |                                                            |
|onChange                 |          |                                                            |
|className                |          |                                                            |
|required = false         |          |                                                            |
|disabled = false         |          |                                                            |
|multiple = false         |          |                                                            |
|optionClassName          |          |                                                            |
|selectedClassName        |          |                                                            |
|maximumSelectionLength   | number   |  Need update > 0. Default nolimit                          |
|keyLabel                 |          |  list object (key for selected)                            |
|keyValue                 |          |  list object (label for selected)                          |
|closeOnSelect            | boolean  |  Default. (False)                                          |
|placeholder              |          |                                                            |
|noFoundData              | func     |  set text when search no data                              |
|noOptionData             | func     |  set text when no option                                   |
|onHidden                 | func     |                                                            |
|select2Config = {}       |          |                                                            |
|templateOption           |          |                                                            |
|templateDisplay          |          |                                                            |
|customCheckSelect        | func     |                                                            |
|customFilterData         | func     |                                                            |

#####

<br />

Something checking! (idea, v.v..)
<br />

#### RUN

<a href="https://codesandbox.io/s/5zuwr">LIVE EXAMPLE</a>

```js
npm install
```
```js
npm run dev
npm run start
```

### License

MIT

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