Skip to content
On this page

useDarkMode

Hook using Dark mode.

Code demonstration

API

const [darkMode, setDarkMode] = useDarkMode()
const [darkMode, setDarkMode] = useDarkMode()

Result

PropertyDescriptionType
darkModeIs it in dark modeComputedRef<boolean>
setDarkModeSet the dark mode, and the undefined is the following systemboolean | undefined

Source

SourceDocsDemo