The Switch is a toggle control that lets users turn an option on or off, commonly used for settings and preferences.
The Switch component provides a simple on/off toggle UI with smooth animations. It's great for enabling or disabling features without using traditional checkboxes.
The ThemeSwitch component allows users to easily switch between light, dark, and system themes with animated transitions. It's ideal for providing a user-friendly way to control the application's appearance.
| Component | Prop | Type | Description |
|---|---|---|---|
| ToggleButton | checkedValue | boolean | Whether the toggle is on (true) or off (false). |
| onChange | (checked: boolean) => void | Callback function triggered when the toggle changes state. | |
| ThemeSwitch | onChange | (theme: "light" | "dark" | "system") => void | Callback function triggered when the theme changes. |
| initialTheme | "light" | "dark" | "system" | The initial theme to display. Defaults to "light". |