# use-input-hook

> Stateful hook for input components

Latest version **1.0.2** (published 2020-11-14) · MIT license · 0 weekly downloads

## Install

```sh
npm install use-input-hook
pnpm add use-input-hook
yarn add use-input-hook
bun add use-input-hook
```

## Health

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

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2020-11-14 |
| First published | 2020-01-12 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Node | >=8 |
| Dependencies | 0 |
| Unpacked size | 4.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | siddharthmantri |
| Maintainers | newtt |

## Links

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

## Recent versions

- 1.0.2 (latest) — 2020-11-14
- 1.0.1 — 2020-02-02
- 1.0.0 — 2020-01-16
- 0.3.1 — 2020-01-16
- 0.3.0 — 2020-01-16
- 0.2.1 — 2020-01-12
- 0.2.0 — 2020-01-12
- 0.1.1 — 2020-01-12
- 0.1.0 — 2020-01-12

## README

# use-input

> Stateful hook for controlled input components

[![NPM](https://img.shields.io/npm/v/use-input.svg)](https://www.npmjs.com/package/use-input-hook) [![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)

## Install

```bash
npm install --save use-input-hook
```

## Usage

```tsx
import * as React from 'react'

import useInput from 'use-input-hook';

const App = () => {
	const [inputValue, onInputChange] = useInput("");
	const [textAreaValue, onTextAreaChange] = useInput("");
	const [checkBoxValue, onCheckboxChange] = useInput(false, 'checked');
	return (
		<>
			<div>
				Input: <input type='text' value={inputValue} onChange={onInputChange} />
			</div>
			<div>
				Textarea: <textarea value={textAreaValue} onChange={onTextAreaChange} />
			</div>
			<div>
				Checkbox: <input type="checkbox" value={checkBoxValue} onChange={onCheckboxChange} />
			</div>
		</>
	)
}
```

## License

MIT © [SiddharthMantri](https://github.com/SiddharthMantri)

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