Installation
Examples
Basic Toggle
Usage
import { useState } from "react";
import { ToggleButton } from "@/components/sillybitsui/toggle-button";function Example() {
const [isOn, setIsOn] = useState(false);
return <ToggleButton isOn={isOn} handleToggle={() => setIsOn(!isOn)} />;
}Props
| Prop | Type | Default | Description |
|---|---|---|---|
className | string | - | Additional classes to style the button. |
isOn | boolean | false | Controls whether the toggle is in the “on” state. |
handleToggle | () => void | - | Callback triggered when the toggle is clicked. |