useTheme
useTheme
is a custom hook used to get the active theme object, active color mode, and a function to toggle the active color mode.
#
Importimport { useTheme } from "pearl-ui";
#
Return valueName | Type | Description |
---|---|---|
theme | Theme configuration object for the active color mode | |
colorMode | Active color mode | |
toggleColorMode | Function to toggle the active color mode |
#
Usageconst { theme, colorMode, toggleColorMode } = useTheme();