SSE Hooks

useTernaryDarkMode

Custom hook that manages ternary (system, dark, light) dark mode with local storage support.

Installation

npx sse-tool add use-ternary-dark-mode

Usage

import { useTernaryDarkMode } from "./{hooks file}";

const {
  isDarkMode,
  ternaryDarkMode,
  setTernaryDarkMode,
  toggleTernaryDarkMode,
} = useTernaryDarkMode({ defaultValue: "dark" });
// Access and use the dark mode state and provided helper functions.

API

Parameters

NameTypeDescription
optionsTernaryDarkModeOptionsOptions or the local storage key for the hook.

Return Value

Returns TernaryDarkModeReturn.

An object containing the dark mode state and helper functions.

Changelog

c165d — feat: enhance useRoleGuard and useSSR hooks with additional options and documentation

30da4 — feat: add new hooks and their metadata

cf13e — feat: add custom hooks for step navigation, ternary dark mode, timeout, toggle, unmount, and window size

Built with Love • © 2026