0.0.1 • Published 11 months ago

react-toggle-checked v0.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
11 months ago

#React Toggle Checked react-toggle-checked is a customizable React component that provides an elegant toggle switch. It allows you to create switches with flexible styles and sizes, making it easy to integrate into your React applications.

#Installation

import { ToggleSwitch } from  'react-toggle-checked'
import 'react-toggle-check/dist/style.css'

#Usage

<ToggleSwitch
size="medium"
onBackgroundColor="#40679E"
offBackgroundColor="#ccc"
onColor="#1B3C73"
offColor="#F6F5F2"
checked={true}
onChange={(e) => console.log(e.target.checked)}
/>
PropTypeDefaultDescription
size"small""medium"Sets the size of the toggle switch.
"medium"
"large"
onBackgroundColorstring"#40679E"Background color when the switch is in the "on" state.
offBackgroundColorstring"#ccc"Background color when the switch is in the "off" state.
onColorstring"#1B3C73"Color of the toggle handle in the "on" state.
offColorstring"#F6F5F2"Color of the toggle handle in the "off" state.
checkedbooleanfalseIf true, the toggle is checked (controlled component).
onChangefunction(e)Callback function that triggers when the switch is toggled
disabledbooleanIf true, disables the toggle.
...propsanyAny additional props are passed to the underlying element.
0.0.1

11 months ago

0.0.2

11 months ago