# @aspnxdd/react-stepper

> 🧩 React custom stepper component

Latest version **0.0.42** (published 2022-08-22) · MIT license · 0 weekly downloads

## Install

```sh
npm install @aspnxdd/react-stepper
pnpm add @aspnxdd/react-stepper
yarn add @aspnxdd/react-stepper
bun add @aspnxdd/react-stepper
```

## Health

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

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.42 |
| Published | 2022-08-22 |
| First published | 2022-08-19 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 6.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Arnau Espin |
| Maintainers | aspnxdd |
| Keywords | typescript, react, stepper, react-stepper, react-component |

## Links

- npm: https://www.npmjs.com/package/@aspnxdd/react-stepper
- Repository: https://github.com/aspnxdd/react-stepper
- Homepage: https://arnau-portfolio.vercel.app/
- Issues: https://github.com/aspnxdd/react-stepper/issues
- npm.io page: https://npm.io/package/@aspnxdd/react-stepper

## 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.0.42 (latest) — 2022-08-22
- 0.0.41 — 2022-08-21
- 0.0.4 — 2022-08-21
- 0.0.31 — 2022-08-21
- 0.0.3 — 2022-08-21
- 0.0.2 — 2022-08-19
- 0.0.1 — 2022-08-19

## README

## React-stepper

Basic react stepper component:

![image](https://user-images.githubusercontent.com/43625217/185811038-4e479d4e-5836-4ea9-93d7-aab02526ea79.png)

[Demo!](https://react-stepper.vercel.app/)

### Install:

```sh
$ npm i @aspnxdd/react-stepper
```
[Npm link](https://www.npmjs.com/package/@aspnxdd/react-stepper)

### Example:

```ts
const options: Options = {
  squared: false,
  color: "blue",
  noAnimation: false,
  distance: 9,
};

const defaultSteps: Props[] = [
  {
    text: "Fetching users",
    status: "loading",
    id: 1,
  },
  {
    text: "Fetching data",
    status: "loading",
    id: 2,
  },
  {
    text: "Uploading data",
    status: "loading",
    id: 3,
  },
];

async function sleep(ms: number) {
  return new Promise((resolve) => setTimeout(resolve, ms));
}

export default function App() {
  const [steps, setSteps] = useState<Props[]>([]);

  async function simulation() {
    setSteps(defaultSteps);
    await sleep(2000);
    setSteps((e) => {
      e[0].status = "completed";
      return [...e];
    });
    await sleep(2000);
    setSteps((e) => {
      e[1].status = "completed";
      return [...e];
    });
    await sleep(2000);
    setSteps((e) => {
      e[2].status = "completed";
      return [...e];
    });
  }

  return (
    <>
      <button onClick={simulation}>Simulation</button>
      <Stepper steps={steps} options={options} />
    </>
  );
}
```

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