
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
react-switchery
Advanced tools
react-switchery is a simple react component adopted from Switchery that helps you turn your default HTML checkbox inputs into beautiful iOS 7 style switches in just few simple steps. You can easily customize switches, so that they match your design perfectly. Also have a typescript definition.
npm install react-switchery --save
<link rel="stylesheet" href="https://cdn.jsdelivr.net/jquery.switchery/0.8.1/switchery.min.css" />
<script src="https://cdn.jsdelivr.net/jquery.switchery/0.8.1/switchery.min.js"></script>
<link rel="stylesheet" href="node_modules/switchery/standalone/switchery.css" />
<script src="node_modules/switchery/standalone/switchery.js"></script>
Or download Switchery and include it in HTML in your own way.
The default value for the switch eg:true - Will keep the switch on false - Will keep the switch off Default: true
Sets the required class to true, (in case you need validation by your form) Default: false
The object of options provided by switchery. Refer switchery for options Default: { color : '#64bd63' , secondaryColor : '#dfdfdf' , jackColor : '#fff' , jackSecondaryColor: null , className : 'switchery' , disabled : false , disabledOpacity : 0.5 , speed : '0.1s' , size : 'default' }
The function that is called when the user switches the state of the switch. You will get the boolean value of the state changed. Default: none
The CSS class name for the container div of the switch component Default: none
The label for the switch component Default: none
import React from 'react';
import Switch from 'react-switchery';
class ComponentWithSwitch extends React.Component {
onChange(value) {
console.log(value);
}
render() {
return(
<Switch
className="switch-class"
onChange={this.onChange}
options={
{
color: '#474F79',
size: 'small'
}
}
checked
/>
);
}
}
export default ComponentWithSwitch;
MIT
FAQs
IOS 7 style switch component for React
The npm package react-switchery receives a total of 0 weekly downloads. As such, react-switchery popularity was classified as not popular.
We found that react-switchery demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

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.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.