# @aeroxmotion/react-selectable

> My own implementation of `react-selectable-fast`

Latest version **0.3.0** (published 2021-09-07) · 0 weekly downloads

## Install

```sh
npm install @aeroxmotion/react-selectable
pnpm add @aeroxmotion/react-selectable
yarn add @aeroxmotion/react-selectable
bun add @aeroxmotion/react-selectable
```

## Health

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

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.3.0 |
| Published | 2021-09-07 |
| First published | 2021-08-31 |
| Weekly downloads | 0 |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 2 |
| Unpacked size | 21.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | aeroxmotion |

## Links

- npm: https://www.npmjs.com/package/@aeroxmotion/react-selectable
- npm.io page: https://npm.io/package/@aeroxmotion/react-selectable

## Dependencies (2)

- [react](https://npm.io/package/react.md) ^17.0.0
- [react-dom](https://npm.io/package/react-dom.md) ^17.0.0

## Recent versions

- 0.3.0 (latest) — 2021-09-07
- 0.2.1 — 2021-09-01
- 0.2.0 — 2021-09-01
- 0.1.0 — 2021-08-31

## README

# @aeroxmotion/react-selectable

My own implementation of `react-selectable-fast`

## Simple usage

```tsx
import { render } from 'react-dom'
import {
  SelectableArea,
  SelectableItem,
  SelectionBox,
} from '@aeroxmotion/react-selectable'

const items = [
  {
    id: 1,
    name: 'Selectable 1',
  },
  {
    id: 2,
    name: 'Selectable 2',
  },
  {
    id: 3,
    name: 'Selectable 3',
  },
]

const MyComponent = () => {
  return (
    <SelectableArea>
      <SelectionBox />

      {items.map((item) => (
        <SelectableItem key={item.id}>
          <p>{item.name}</p>
        </SelectableItem>
      ))}
    </SelectableArea>
  )
}

render(<MyComponent />, document.getElementById('root'))
```

## How it works

This library uses an event-based approach to detect selected items by injecting an `EventEmitter` through context to every selectable item.

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