Socket
Book a DemoInstallSign in
Socket

react-wizard-flow

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-wizard-flow

react-wizard-flow

1.0.4
latest
Source
npmnpm
Version published
Weekly downloads
3
-40%
Maintainers
1
Weekly downloads
 
Created
Source

react-wizard-flow

npm downloads gzip size npm version PRs Welcome

Usage

import { createWizardFlow, useWizardFlow } from 'react-wizard-flow';

enum TestSteps {
  step1,
  step2,
}

const WizardFlow = createWizardFlow(TestSteps);

function Step1() {
  const { transition, close } = useWizardFlow(WizardFlow);
  return (
    <div>
      <header>Step 1</header>
      <button onClick={() => transition(TestSteps.step1)}>To Step 1</button>
      <button onClick={() => transition(TestSteps.step2)}>To Step 2</button>
      <button onClick={close}>Close</button>
    </div>
  );
}

function Step2() {
  const { transition, close } = useWizardFlow(WizardFlow);
  return (
    <div>
      <header>Step 1</header>
      <button onClick={() => transition(TestSteps.step1)}>To Step 1</button>
      <button onClick={() => transition(TestSteps.step2)}>To Step 2</button>
      <button onClick={close}>Close</button>
    </div>
  );
}

const STEPS = {
  [TestSteps.step1]: <Step1 />,
  [TestSteps.step2]: <Step2 />,
};

export default function() {
  const onClose = () => { console.log('Flow closed'); }
  return <WizardFlow.Provider initialStep={TestSteps.step1} steps={STEPS} onClose={onClose} />
}

This README was generated by anansi.

Keywords

anansi

FAQs

Package last updated on 14 May 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.