npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@mshafiqyajid/react-stepper

v0.3.1

Published

Multi-step wizard / stepper hook and styled component for React. Linear or non-linear, validation gates, progress indicator. Zero dependencies, fully typed.

Readme

@mshafiqyajid/react-stepper

Multi-step wizard / stepper for React. Headless useStepper hook + styled component. Linear or non-linear progression, validation gates, async-aware, horizontal or vertical layout. Zero dependencies, fully typed.

Full docs →

Install

npm install @mshafiqyajid/react-stepper

Quick start (styled)

import { StepperStyled } from "@mshafiqyajid/react-stepper/styled";
import "@mshafiqyajid/react-stepper/styles.css";

<StepperStyled
  steps={[
    { id: "account", label: "Account", description: "Email + password" },
    {
      id: "billing",
      label: "Billing",
      description: "Card details",
      validate: () => formIsValid || "Add a payment method",
    },
    { id: "review", label: "Review" },
  ]}
  content={{
    account: <AccountForm />,
    billing: <BillingForm />,
    review: <ReviewSummary />,
  }}
  onFinish={() => submit()}
/>

Headless

import { useStepper } from "@mshafiqyajid/react-stepper";

const stepper = useStepper({ steps, mode: "linear" });

<>
  {steps.map((s, i) => (
    <button
      key={s.id}
      onClick={() => stepper.goTo(i)}
      aria-current={stepper.activeStep === i ? "step" : undefined}
      disabled={s.disabled}
    >
      {s.label}
    </button>
  ))}

  <div>{content[stepper.activeStepId]}</div>

  <button onClick={() => void stepper.goNext()}>Next</button>
</>

Features

  • Linear / non-linearmode: "linear" (default) requires sequential progression; "non-linear" allows arbitrary jumps.
  • Validation gates — each step accepts a validate: () => boolean | string | Promise<...>. Return true to allow goNext; return a string to set error.
  • Async-awarevalidate may return a Promise. The hook tracks isPending so the UI can disable controls while validating.
  • Horizontal or vertical layout via orientation.
  • Disabled steps — set disabled: true on a step to skip it during prev/next navigation.
  • Resetstepper.reset() returns to the first step + clears completed/visited state.

Props (styled)

| Prop | Type | Default | Description | |------|------|---------|-------------| | steps | StepperStep[] | — | Required | | content | Record<id, ReactNode> | — | Step content keyed by step id | | renderContent | (ctx) => ReactNode | — | Alternative to content | | renderStep | (ctx) => ReactNode | — | Custom step indicator | | orientation | "horizontal" \| "vertical" | "horizontal" | Layout direction | | size | "sm" \| "md" \| "lg" | "md" | Indicator size | | tone | "neutral" \| "primary" | "primary" | Active accent | | mode | "linear" \| "non-linear" | "linear" | Navigation mode | | defaultStep / step / onStepChange | controlled state | — | Active step | | defaultCompleted / completed / onCompletedChange | controlled completed ids | — | — | | onFinish | () => void | — | Fires on Finish (after final-step validate) | | showFooter | boolean | true | Built-in Back / Next / Finish buttons | | clickableSteps | boolean | true | Allow clicking visited / earlier steps | | progressBar | boolean | false | Render a thin progress bar (completed / total) above the steps | | labels | { back?, next?, finish?, optional? } | — | Customise footer button + "(optional)" labels |

StepperStep

| Field | Type | Description | |-------|------|-------------| | id | string | Required, unique | | label | ReactNode | Required | | description | ReactNode? | Sub-text below label | | icon | ReactNode? | Custom indicator icon | | disabled | boolean? | Skipped by prev/next | | optional | boolean? | Renders "(optional)" next to the label | | error | boolean? | Mark indicator as failed (shake animation, danger ring) | | validate | () => boolean \| string \| Promise<...> | Run before leaving this step |

License

MIT