Skip to content

useThemeMode

TThis hook is used to get the current theme mode of the application. It returns the current theme mode, a function to set the theme mode, a function to clear the theme mode, and a function to toggle the theme mode.

Import

Terminal window
import { useThemeMode } from "@aeonkit/react";

Parameters

This hook does not take any parameters.

Usage

const { mode, setMode, clearMode, toggleMode } = useThemeMode()

Use the mode value to get the current theme mode of the application. You can use the setMode function to set the theme mode, the clearMode function to clear the theme mode, and the toggleMode function to toggle the theme mode.

Returns

  • mode - (light | dark): The current theme mode of the application.
  • setMode - ((t?: ThemeMode) => void): A function to set the theme mode.
  • clearMode - (() => void): A function to clear the theme mode.
  • toggleMode - (() => void): A function to toggle the theme mode.