Socket
Socket
Sign inDemoInstall

react-stepper-horizontal

Package Overview
Dependencies
21
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.0.0 to 1.0.1

32

example/example.js
'use strict';
import React from 'react';
import React, { Component } from 'react';
import ReactDOM from 'react-dom';
import Stepper from '../src/index.js';
let App = React.createClass({
class App extends Component {
constructor() {
super();
this.state = {
steps: ['Step One', 'Step Two', 'Step Three', 'Step Four'],
currentStep: 0,
};
this.onClickNext = this.onClickNext.bind(this);
}
onClickNext() {
const { steps, currentStep } = this.state;
this.setState({
steps: steps.map((s, i) => (i == currentStep ? `${s} Completed` : s)),
currentStep: currentStep + 1,
});
}
render() {
const steps = ['Step One', 'Step Two', 'Step Three', 'Step Four'];
const { steps, currentStep } = this.state;
const buttonStyle = { background: '#E0E0E0', width: 200, padding: 16, textAlign: 'center', margin: '0 auto', marginTop: 32 };
return (
<div style={ { height: 200, width: 600 } }>
<Stepper steps={ steps } activeStep={ 1 } />
<div>
<Stepper steps={ steps } activeStep={ currentStep } />
<div style={ buttonStyle } onClick={ this.onClickNext }>Next</div>
</div>
);
}
});
};
ReactDOM.render(<App />, document.getElementById('content'));

2

package.json
{
"name": "react-stepper-horizontal",
"version": "1.0.0",
"version": "1.0.1",
"description": "Well-designed stepper component for react",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

@@ -14,2 +14,12 @@ # react-stepper

## Usage
```
render() {
return (
<div>
<Stepper steps={ ['Step One', 'Step Two', 'Step Three', 'Step Four'] } activeStep={ 1 } />
</div>
);
}
```
See full example [here](https://github.com/mu29/react-stepper/blob/master/example/example.js)

@@ -16,0 +26,0 @@ ## API

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc