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

NameTypeDescriptionDefault
noneTypically none; reads from a `ThemeContext`.-

Returns

NameDescription
themeObject with tokens (colors, spacing, fonts).
setThemeFunction 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`.
Saha UI - The Modern React Component Library