import { Toggle } from "@wfp/react"; () => { return ( <Toggle defaultToggled labelA="Off" labelB="On" name="togglename" /> ); };
boolean
Specify whether the toggle should be on by default
Use this to make the component controlled. If toggled is passed, the component will not manage its own state.
toggled
string
Specify the label for the "off" position
Specify the label for the "on" position
(value: boolean,htmlFor: string,event: ChangeEvent<HTMLInputElement>) => void
A callback function that is called when the toggle is clicked. It receives the new boolean state, the input's ID, and the original event. This is the recommended handler for new implementations.
Provide an id that unique represents the underlying input
input
Provide an name that unique represents the underlying input
(event: ChangeEvent<HTMLInputElement>) => void
Provide a function that is called when a change event occurs on the control
any