# react-pure-ui

> Development component for connecting stateless components to an array of states

Latest version **0.5.0** (published 2017-03-15) · MIT license · 0 weekly downloads

## Install

```sh
npm install react-pure-ui
pnpm add react-pure-ui
yarn add react-pure-ui
bun add react-pure-ui
```

## 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.5.0 |
| Published | 2017-03-15 |
| First published | 2017-02-07 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 4 |
| Author | Tim Hudson |
| Maintainers | timhudson |
| Keywords | react, reactjs |

## Links

- npm: https://www.npmjs.com/package/react-pure-ui
- Repository: https://github.com/timhudson/react-pure-ui
- Issues: https://github.com/timhudson/react-pure-ui/issues
- npm.io page: https://npm.io/package/react-pure-ui

## Dependencies (1)

- [keycode](https://npm.io/package/keycode.md) ^2.1.8

## 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.5.0 (latest) — 2017-03-15
- 0.4.0 — 2017-02-10
- 0.3.0 — 2017-02-09
- 0.2.2 — 2017-02-07
- 0.2.1 — 2017-02-07
- 0.2.0 — 2017-02-07

## README

# react-pure-ui

Development component for connecting stateless components to an array of states

**This should not be used in production**

## Example

``` js
import React from 'react'
import { render } from 'react-dom'
import { pure } from 'react-pure-ui'

const Component = (props) => <h1>{props.children} fish</h1>

const states = [
  { children: 'one' },
  { children: 'two' },
  { children: 'red' },
  { children: 'blue' }
]

const PureComponent = pure('unique-key-for-component', states)(Component)

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

## Usage

### pure(key, states)(Component)

Connects a stateless component to an array of possible states, allowing keyboard navigation through states with ← and →. Any `props` passed in will be merged with the active state with the latter taking precedence.

### Key commands

- `Left Arrow` – navigate to the previous state
- `Right Arrow` – navigate to the next state
- `Escape` – turn off pure-ui state, passing through props rather than using states.

## License

MIT

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