Theming
useTheme
Access theme context including current theme values and configuration.
import { useTheme } from "saha-ui"Uses
Access theme context and expose current theme tokens and configuration. Useful for components that need design tokens and theme-aware styling.
Props
| Name | Type | Description | Default |
|---|---|---|---|
| none | Typically none; reads from a `ThemeContext`. | - |
Returns
| Name | Description |
|---|---|
| theme | Object with tokens (colors, spacing, fonts). |
| setTheme | Function to switch or augment the theme. |
| resolveToken(name) | Helper to resolve token values. |
Example
const { theme, setTheme } = useTheme(); console.log(theme.colors.primary);Notes
If you want this implemented I can add a `ThemeContext` and a hook similar to `useColorMode`.