Sajari UI

useDarkMode

useDarkMode is a custom hook to handle toggling dark mode and storing it in local storage. It will also get the user's preference to set the initial state.

Return value

The useDarkMode hook returns an an array with currentValue, and a setter.

Import

Usage

Editable Example
Currently in light mode