Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Module

x/netzo/deps/usehooks-ts.ts>useTernaryDarkMode

Full-stack Deno framework for building business web apps like internal tools, dashboards, admin panels and automated workflows.
Go to Latest
function useTernaryDarkMode
Deprecated
Deprecated

this useTernaryDarkMode's signature is deprecated, it now accepts an options object instead of multiple parameters.

import { useTernaryDarkMode } from "https://deno.land/x/netzo@0.4.78/deps/usehooks-ts.ts";

Custom hook for managing ternary (system, dark, light) dark mode with local storage support.

Examples

const { isDarkMode, ternaryDarkMode, setTernaryDarkMode, toggleTernaryDarkMode } = useTernaryDarkMode('my-key'); // Access and use the dark mode state and provided helper functions.

Parameters

localStorageKey: string
  • The key for storing dark mode preference in local storage (default is 'usehooks-ts-ternary-dark-mode').

Returns

TernaryDarkModeResult

An object containing the dark mode state and helper functions.