# vdom-input

> virtual-dom wrapper around input element

Latest version **0.0.11** (published 2016-03-09) · ISC license · 0 weekly downloads

## Install

```sh
npm install vdom-input
pnpm add vdom-input
yarn add vdom-input
bun add vdom-input
```

## 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.0.11 |
| Published | 2016-03-09 |
| First published | 2015-10-09 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 4 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Nick Thomas |
| Maintainers | nichoth |
| Keywords | virtual-dom, mercury, component, ui, input |

## Links

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

## Dependencies (4)

- [xtend](https://npm.io/package/xtend.md) ^4.0.0
- [virtual-dom](https://npm.io/package/virtual-dom.md) ^2.1.1
- [@nichoth/state](https://npm.io/package/@nichoth/state.md) 0.0.0
- [@nichoth/keycodes](https://npm.io/package/@nichoth/keycodes.md) 0.0.3

## Alternatives

- [@progress/kendo-ooxml](https://npm.io/package/@progress/kendo-ooxml.md) — 152.1K weekly downloads
- [@progress/kendo-react-ripple](https://npm.io/package/@progress/kendo-react-ripple.md) — 8.0K weekly downloads
- [@progress/kendo-react-orgchart](https://npm.io/package/@progress/kendo-react-orgchart.md) — 4.3K weekly downloads
- [@praxisui/dynamic-fields](https://npm.io/package/@praxisui/dynamic-fields.md) — 2.4K weekly downloads
- [@mesalvo/react-ui](https://npm.io/package/@mesalvo/react-ui.md) — 1.7K weekly downloads

## Recent versions

- 0.0.11 (latest) — 2016-03-09
- 0.0.10 — 2016-01-12
- 0.0.9 — 2016-01-11
- 0.0.8 — 2015-11-10
- 0.0.7 — 2015-10-12
- 0.0.6 — 2015-10-11
- 0.0.5 — 2015-10-11
- 0.0.3 — 2015-10-09
- 0.0.2 — 2015-10-09
- 0.0.0 — 2015-10-09

## README

# vdom input

`virtual-dom` wrapper around an input element. Returns an observable state object usable with the [mercury](https://github.com/Raynos/mercury) interface.


## install

    $ npm install vdom-input


## example

```js
var vdom = require('virtual-dom');
var h = vdom.h;
var Input = require('vdom-input');

// return observable state object
var state = Input({

  value: 'example',

  // passed to html element
  attrs: {
    style: {
      color: 'red'
    },
    placeholder: 'placeholder'
  },

  // tab in an input that contains text
  onComplete: function() {
    console.log('complete');
  },
  // backspace in an input without any value
  onDelete: function() {
    console.log("delete");
  }

});

var loop = require('main-loop')(state(), Input.render, vdom);
state(loop.update);
document.getElementById('content').appendChild(loop.target);
```


## methods

### Input.hasValue(state)

Return boolean

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