react-switch-pro
TypeScript icon, indicating that this package has built-in type declarations

0.1.7 • Public • Published

Getting Started with react-switch-pro

license-isc

Demo

type="dayNight"

type="heart"

type="light"

Installation

npm install --save react-switch-pro

Usage

import { ToggleSwitch } from 'react-switch-pro';
const [isChecked, setIsChecked] = React.useState(false);
<ToggleSwitch type="light" className="custom" name="day-night" checked={isChecked} onChange={(value, name) => setIsChecked(value, name)} />
import { ToggleSwitch } from 'react-switch-pro';
const [isChecked, setIsChecked] = React.useState(false);

function App() {
	const [isChecked, setIsChecked] = React.useState(false);
	return (
		<div className="App">
			<ToggleSwitch
				type="light"
				className="custom"
				name="day-night"
				checked={isChecked}
				onChange={(value, name) => setIsChecked(value, name)}
			/>
		</div>
	);
}

Package Sidebar

Install

npm i react-switch-pro

Weekly Downloads

20

Version

0.1.7

License

ISC

Unpacked Size

33.2 kB

Total Files

14

Last publish

Collaborators

  • sathishsaminathan