Switch

The Switch is a toggle control that lets users turn an option on or off, commonly used for settings and preferences.

Toggle Switch

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.

Theme Switch

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.

API Reference

ComponentPropTypeDescription
ToggleButtoncheckedValuebooleanWhether the toggle is on (true) or off (false).
onChange(checked: boolean) => voidCallback function triggered when the toggle changes state.
ThemeSwitchonChange(theme: "light" | "dark" | "system") => voidCallback function triggered when the theme changes.
initialTheme"light" | "dark" | "system"The initial theme to display. Defaults to "light".