1.0.7 • Published 6 years ago
react-triple-toggle v1.0.7
Installation
npm i react-triple-toggle --save
Usage
Uncontrolled component
import React, { useState } from "react";
import ReactDOM from "react-dom";
import { Toggle } from "react-triple-toggle";
function App() {
return <Toggle />;
}
const rootElement = document.getElementById("root");
ReactDOM.render(<App />, rootElement);
API
Prop | Type | Description |
---|---|---|
checked | object | Use this if you want to treat the toggle as a controlled component. |
defaultChecked | object | Use this if you want to treat the toggle as an uncontrolled component. |
onChange | function | A function which acts as a callback when the toggle is changed. |
disabled | boolean | If true , the toggle is disabled. If false , the toggle is enabled |
Built With
- React - A JavaScript library for building user interfaces
License
MIT Licensed. Copyright (c) George Bardi 2019.