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

es-wizard

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

es-wizard

Wizard component that walks users through a step-based workflow

  • 0.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2
decreased by-83.33%
Maintainers
1
Weekly downloads
 
Created
Source

ES Wizard

This is a compound component for building a Wizard workflow.

Installation

npm install -S es-wizard

Usage

function MyApp() {
   const model = {
    stepOne: {
      fruits: ['Banana', 'Apple', 'Strawberries']
    },
    stepTwo: {
      name: "Jake",
      age: "28"
    }
  };

  return (
    <Wizard
      model={model}
      completeWizard={() => console.log('All done!')}
    >
      <Wizard.Step
        id="step1"
        modelSelector={wizardModel => wizardModel.stepOne}
        isPersistent={false}
        render={({ stepModel }) => {
          return (
            <div>
              <h3>Fruits</h3>
              <ul>
                {stepModel.fruits.map(fruit => <li>{fruit}</li>)}
              </ul>
            </div>
          );
        }} 
      />
      <Wizard.Step
        id="step2"
        modelSelector={wizardModel => wizardModel.stepTwo}
        persist={model => {
          console.log(model);
          return Promise.resolve();
        }}
        render={({ stepModel, update }) => {
          return (
            <div>
              <label htmlFor="name">Name</label>
              <input 
                id={name}
                onChange={event => update(wizardModel => {
                  return Object.assign(wizardModel, { stepTwo: { ...wizardModel.stepTwo, name: event.target.value }});
                })}
                defaultValue={stepModel.name} type="text" 
              />
    
              <p><strong>{stepModel.name}</strong> is {stepModel.age} years old</p>
            </div>
          );
        }} 
      />
      <Wizard.Step
        id="step3"
        isPersistent={false}
        modelSelector={wizardModel => wizardModel.stepTwo}
        render={({ stepModel }) => {
          return (
            <div>
              <p><strong>{stepModel.name}</strong> is {stepModel.age} years old</p>
            </div>
          );
        }} 
      />
    </Wizard>
  );
}

FAQs

Package last updated on 29 Dec 2017

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

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc