# react-bathrobe

> A library that simplifies context management in steps. Animations are provided as a bonus.

Latest version **1.0.2** (published 2023-10-20) · Apache-2.0 license · 0 weekly downloads

## Install

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

## Health

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

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2023-10-20 |
| First published | 2023-10-19 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | >=8 |
| Dependencies | 1 |
| Unpacked size | 25.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | qr3n |
| Maintainers | qr3n |
| Keywords | react, typescript, npm |

## Links

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

## Dependencies (1)

- [framer-motion](https://npm.io/package/framer-motion.md) ^10.16.4

## 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.2 (latest) — 2023-10-20
- 1.0.1 — 2023-10-19
- 1.0.0 — 2023-10-19

## README

# Bathrobe
A library that simplifies context management in steps. Animations are provided as a bonus.

# How to use

```tsx
import { BathrobeProvider, useBathrobeContext, useSteps } from "bathrobe";
import { useState } from 'react'

interface ISomeContextData {
  hello: string,
  world: string
}

const SomeSteps = () => {
  const steps = useSteps<ISomeContextData>(3, {
    hello: 'Hello',
    world: 'World'
  })

  return (
    <BathrobeProvider steps={steps}>
      <Step1/>
      <Step2/>
    </BathrobeProvider>
  )
}

const Step1 = () => {
  const { hello } = useBathrobeContext<ISomeContextData>()
  
  return (
    <h1>
      { hello }
    </h1>
  )
}

const Step2 = () => {
  const { world } = useBathrobeContext<ISomeContextData>()

  return (
    <h1>
      { world }
    </h1>
  )
}
```

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