Toggles are used to switch between two states. They are commonly used in settings, forms, and more.
import Toggle from "@radui/ui/Toggle"; const ToggleExample = () => { const [pressed, setPressed] = React.useState(false) const handleChange = (newPressed) => { setPressed(newPressed) } return ( <Toggle pressed={pressed} onChange={handleChange}> <Icon /> </Toggle> ) }Show more
import Toggle from "@radui/ui/Toggle"; const ToggleExample = () => { const [pressed, setPressed] = React.useState(false) const handleChange = (newPressed) => { setPressed(newPressed) } return ( <Toggle pressed={pressed} onChange={handleChange}> <Icon /> </Toggle> ) }
color