0.0.5 • Published 7 years ago
status-button v0.0.5
Status Button
simple customizable status buttons to change the UI ##Installation
npm install status-button --save##How to use Very simple here's a code snippet of StatusButton andt StatusButtonToggle with default props
import { StatusButton, StatusButtonToggle } from 'status-button';
class App extends React.Component{
constructor(props)
{
super(props)
this.state={
status:"something",
flag:true
}
}
render(){
return(
<div style={{height:"100%", width:"100%", marginTop:"120px"}} align="middle">
<div>
<StatusButton
buttonClick1={()=>{this.setState({status:"hello"})}}
buttonClick2={()=>{this.setState({status:"world"})}}
/>
</div>
<div style={{color:"red"}}>{this.state.status}</div>
<StatusButtonToggle
onclick={()=>{this.setState((prevState)=>({flag:!prevState.flag}))}}
/>
</div>
)
}
}###All the props of StatusButton
status1: left button name | default: "O"status2: right button name | default: "I"buttonClick1: pass your left button function herebuttonClick2: pass your right button function heresize: give your desired px size (for example size=150) | default: 80backgroundColor: set the inactive button color | default: "lightfgrey"activeColor: set active button color | default: black ###All the props of StatusButtonstatus1: left button name | default: "O"status2: right button name | default: "I"onclick: pass your left button function heresize: give your desired px size (for example size=150) | default: 80backgroundColor: set the inactive button color | default: "lightfgrey"activeColor: set active button color | default: black