Skip to main content
1

Install mode-watcher

Start by installing mode-watcher:
2

Add the ModeWatcher component

Import the ModeWatcher component and use it in your root layout:
src/routes/+layout.svelte
3

Add a mode toggle

Place a mode toggle on your site to toggle between light and dark mode.
The following examples show different approaches to creating a mode toggle. Choose the one that fits your needs.

Light Switch

A simple toggle switch for dark mode:
A dropdown menu with multiple theme options: