Overview
TheuseUniwind hook provides access to the current theme name and adaptive theme status. It automatically triggers a re-render when the theme changes or when adaptive themes are toggled. This is useful when you need to conditionally render components or apply logic based on the active theme.
Usage
When to Use This Hook
TheuseUniwind hook is ideal for scenarios where you need to:
- Display the current theme name in your UI
- Check if adaptive themes (system theme) are enabled
- Conditionally render different components based on the active theme
- Execute side effects when the theme changes
- Access theme information for logging or analytics
Return Values
The name of the currently active theme (e.g.,
"light", "dark", "system", or any custom theme name you’ve defined).Indicates whether adaptive themes are currently enabled. When
true, the app automatically follows the device’s system color scheme. When false, the app uses a fixed theme.Examples
Conditional Rendering Based on Theme
Using Theme in Side Effects
Displaying Current Theme
Reacting to Adaptive Theme Changes
Related
Theming Basics
Learn how to set up and configure themes in Uniwind
Custom Themes
Create and manage custom theme configurations