SSE Hooks

useDarkMode

Custom hook that returns the current state of the dark mode.

Installation

npx sse-tool add use-dark-mode

Usage

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

const { isDarkMode, toggle, enable, disable, set } = useDarkMode({
  defaultValue: true,
});

API

Parameters

NameTypeDescription
optionsDarkModeOptionsThe initial value of the dark mode, default false.

Return Value

Returns DarkModeReturn.

An object containing the dark mode's state and its controllers.

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