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.
Import#
import { useTheme } from "pearl-ui";Return value#
| Name | Type | Description |
|---|---|---|
theme | Theme configuration object for the active color mode | |
colorMode | Active color mode | |
toggleColorMode | Function to toggle the active color mode |
Usage#
const { theme, colorMode, toggleColorMode } = useTheme();