1.0.2 • Published 4 years ago

react-beautiful-switch v1.0.2

Weekly downloads
1
License
ISC
Repository
github
Last release
4 years ago

Beautiful switch with react js

npm

Simple, useful and beautiful switch

Installation

npm install react-beautiful-switch

Usage

import React from "react";
import BeautifulSwitch from "react-beautiful-switch";

function App() {
  return (
    <div className="App">
      <BeautifulSwitch />
    </div>
  );
}

export default App;

Props

PropTypeDefaultDescription
deafultValueboolfalseIf true, the switch is set to checked. If false, it is not checked.
onTextstringyeswill take on this text when it is not checked.
offTextstringnowill take on this text when it is checked.
colorstring#2d3a87switch's color. Only accepts hex-colors.
onChangefuncundefinedfunction to run when switch is changed