useDarkMode
A hook that returns whether the user's device is in dark mode. It reactively updates when the mode changes, making it useful for conditionally styling your widget.
Import
import { useDarkMode } from "~lib/use-dark-mode";
API
const isDarkMode = useDarkMode();
Parameters
This hook takes no parameters.
Return Value
| Name | Type | Description |
|---|---|---|
isDarkMode | boolean | true if the user prefers dark mode, false otherwise |