useSwitch
A custom React hook that provides a simple way to manage boolean state with convenient methods for turning on, off, and toggling the switch.
Import
import { useSwitch } from '@vortex-kit/vortex';Display
const { isEnabled, turnOn, turnOff, flipSwitch } = useSwitch(defaultValue);Return Value
Prop | Type | Default |
|---|---|---|
| | |
| | |
| | |
| |
Parameters
Prop | Type | Default |
|---|---|---|
| | |