# react-robot

> React hooks for Robot finite state machines

Latest version **1.2.1** (published 2025-11-28) · BSD-2-Clause license · 0 weekly downloads

## Install

```sh
npm install react-robot
pnpm add react-robot
yarn add react-robot
bun add react-robot
```

## Health

**Score 50/100 (C)** — status: stable.

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

## Facts

| | |
|---|---|
| Version | 1.2.1 |
| Published | 2025-11-28 |
| First published | 2019-09-12 |
| Weekly downloads | 0 |
| License | BSD-2-Clause |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Unpacked size | 2.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 18 |
| Author | Matthew Phillips |
| Maintainers | matthewp |
| Keywords | React, Finite state machine |

## Links

- npm: https://www.npmjs.com/package/react-robot
- Repository: https://github.com/matthewp/react-robot
- Homepage: https://github.com/matthewp/react-robot#readme
- Issues: https://github.com/matthewp/react-robot/issues
- npm.io page: https://npm.io/package/react-robot

## Dependencies (1)

- [robot-hooks](https://npm.io/package/robot-hooks.md) ^1.1.0

## 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.2.1 (latest) — 2025-11-28
- 1.2.0 — 2025-01-14
- 1.1.0 — 2025-01-14
- 1.0.0 — 2024-11-10
- 0.3.0 — 2023-02-02
- 0.2.3 — 2021-09-29
- 0.2.2 — 2020-12-29
- 0.2.1 — 2019-09-27
- 0.2.0 — 2019-09-19
- 0.1.0 — 2019-09-12

## README

# react-robot

[React](https://reactjs.org/) hooks for use with [Robot](https://thisrobot.life/) finite state machines.

See documentation on [the website](https://thisrobot.life/integrations/react-robot.html).

```js
import { useMachine } from 'react-robot';
import React from 'react';
import { createMachine, state, transition } from 'robot3';

const machine = createMachine({
  one: state(
    transition('next', 'two')
  ),
  two: state()
});

function App() {
  const [current, send] = useMachine(machine);
  
  return html`
    <button type="button" onClick=${() => send('next')}>
      State: ${current.name}
    </button>
  `;
}
```

## 📚 [Documentation](https://thisrobot.life/integrations/react-robot.html)

* Please star [the repository](https://github.com/matthewp/react-robot) on GitHub.
* [File an issue](https://github.com/matthewp/react-robot/issues) if you find a bug. Or better yet...
* [Submit a pull request](https://github.com/matthewp/react-robot/compare) to contribute.

## License

BSD-2-Clause

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