Skip to content

Theme Switcher API Reference

The ToggleMode component is used to programmatically switch between light and dark themes. It provides a simple and convenient way to control the theme state in your application.

PropTypeDefaultDescription
size'sm' | 'md' | 'lg''md'The size of the toggle component
variant'rounded' | 'square''rounded'The shape variant of the toggle component
styleType'filled' | 'outlined' | 'ghost''filled'The visual style type of the toggle component
disabledbooleanfalseWhether the toggle component is disabled
styleViewStyleundefinedCustom style object for the toggle component container
iconSizenumberundefinedCustom size for the icons within the toggle. If not provided, uses default size based on the size prop
paddingnumberundefinedCustom padding for the toggle component. If not provided, uses default padding based on the size prop
animatedbooleantrueWhether to enable smooth animations for state transitions
onPress() => voidundefinedCallback function triggered when the toggle is pressed. Should handle the logic for switching between light/dark modes
enableSystemModebooleanfalseWhether to include system/auto mode as a third option. When enabled, toggle cycles through: light → dark → system

The ThemeManager component is used to manage the theme state in your application. It provides a simple and convenient way to switch between light and dark themes.

PropTypeDefaultDescription
styleStyleProp<ViewStyle>undefinedCustom styles for the main theme manager container
contentStyleStyleProp<ViewStyle>undefinedCustom content styles for the inner content area of theme manager
themePresetsThemePresetConfig[]RequiredArray of theme preset configurations available for selection
initialThemestringundefinedInitial theme preset key to apply when component mounts
showControlsbooleantrueWhether to show the theme controls section (dark mode toggle, etc.)
showPresetsbooleantrueWhether to show the theme presets section
childrenReact.ReactNodeundefinedAdditional content to render below the theme manager
onThemeApplied(theme: string) => voidundefinedCallback function triggered when a theme is successfully applied
onThemePreview(theme: string) => voidundefinedCallback function triggered when a theme is being previewed
customizationThemeManagerCustomizationundefinedOptional customization for labels, messages, and UI text
showCardsbooleantrueWhether to show theme presets as cards with visual previews
PropertyTypeDefaultDescription
controlsTitlestring'Theme Controls'Custom title for theme controls section
presetsTitlestring'Theme Presets'Custom title for theme presets section
darkModeLabelstring'Dark Mode'Custom label for dark mode toggle
darkModeDisabledLabelstring'Dark Mode (Disabled)'Custom label for disabled dark mode
applyButtonTextstring'Apply'Custom text for apply button
cancelPreviewTextstring'Cancel Preview'Custom text for cancel preview button
resetButtonTextstring'Reset'Custom text for reset button
defaultThemeTextstring'Default Theme'Custom text for default theme button
successMessagestring'Theme applied successfully!'Custom success message when theme is applied
errorMessagestring'An error occurred'Custom error message
warningMessagestring'Warning'Custom warning message
infoMessagestring'Information'Custom info message
PropertyTypeDescription
keystringUnique identifier for the theme preset
labelstringHuman-readable display name for the theme preset
configCustomThemeConfigFactoryFactory function that generates the theme configuration