npm.io
0.9.12 • Published 7 years ago

@easyguide/stepper

Licence
MIT
Version
0.9.12
Deps
2
Size
13 kB
Vulns
0
Weekly
0

@easyguide/stepper

Camponents stepper ui

NPM JavaScript Style Guide

Install

npm install --save @easyguide/stepper

Usage

import React, {Component} from 'react'

import Stepper, {withStep} from '@easyguide/stepper'

const Step = withStep(({ previous, next, activeStep }) => (
  <section data-testid="step">
    <h1>{activeStep}</h1>
    <p>description</p>
    <button onClick={previous} data-testid="step-previous-button">
      previous
    </button>
    <button onClick={next} data-testid="step-next-button">
      next
    </button>
  </section>
))

class Example extends Component {
  render() {
    return (
      <Stepper>
        <Step stepName="step 1" />
        <Step stepName="step 2" />
      </Stepper>
    )
  }
}

License

MIT iamtchelo