# select-hook

> virtual-dom hook for setting text selection

Latest version **1.0.0** (published 2015-11-15) · MIT license · 0 weekly downloads

## Install

```sh
npm install select-hook
pnpm add select-hook
yarn add select-hook
bun add select-hook
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2015-11-15 |
| First published | 2015-11-15 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Ben Drucker |
| Maintainers | bendrucker |
| Keywords | select, hook, setSelectionRange, virtual-dom |

## Links

- npm: https://www.npmjs.com/package/select-hook
- Repository: https://github.com/bendrucker/select-hook
- Homepage: https://github.com/bendrucker/select-hook#readme
- Issues: https://github.com/bendrucker/select-hook/issues
- npm.io page: https://npm.io/package/select-hook

## Dependencies (3)

- [xtend](https://npm.io/package/xtend.md) ~4.0.1
- [next-tick](https://npm.io/package/next-tick.md) ~0.2.2
- [virtual-hook](https://npm.io/package/virtual-hook.md) ~1.0.1

## 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

- 1.0.0 (latest) — 2015-11-15

## README

# select-hook [![Build Status](https://travis-ci.org/bendrucker/select-hook.svg?branch=master)](https://travis-ci.org/bendrucker/select-hook)

> virtual-dom hook for setting text selection


## Install

```
$ npm install --save select-hook
```


## Usage

```js
var h = require('virtual-dom/h')
var SelectHook = require('select-hook')

function render (state) {
  return h('input', {
    select: SelectHook({
      start: 0,
      end: 10
    })
  })
}
```

## API

#### `SelectHook([options])` -> `object`

##### options

Type: `object`  
Default: `{start: 0, end: 0}`

An object containing the start and end points of the desired selection.


## License

MIT © [Ben Drucker](http://bendrucker.me)

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