Skip to content

useTheme

useTheme(): ThemeContextValue

Defined in: packages/react/src/components/ui/ThemeProvider.tsx:129

Hook to access the current theme and theme setter.

Must be used inside a <ThemeProvider>.

ThemeContextValue

The theme context value.

When used outside <ThemeProvider>.

const { theme, setTheme } = useTheme();
setTheme("dark");