New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

react-wizard-flow

Package Overview
Dependencies
Maintainers
1
Versions
3
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.2
latest
Source
npm
Version published
Weekly downloads
1
-96.55%
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 07 Apr 2023

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