Interface DarkModeState

interface DarkModeState {
    setTheme: ((selectedTheme: "dark" | "light") => void);
    theme: null | "dark" | "light";
    toggleTheme: (() => void);
}

Properties

setTheme: ((selectedTheme: "dark" | "light") => void)

Sets the current theme to the value passed in as an argument.

theme: null | "dark" | "light"

The currently selected theme or null on the first render when using SSR.

toggleTheme: (() => void)

Changes theme to dark if it is currently light and vice versa.