Basic usage
- User's preferred themes are persisted in localStorage
- Theme change are synced with other windows and tabs via storage event
- To avoid the flashing of wrong theme value, consider putting it in a dropdown menu, or rendering multiple sets and use CSS to show the correct one based on the theme wrapper's attributes
Demo links
App Router
Basic usage →Multi-store with server persistence →
Multi-store with no hydration mismatch →
Pages Router
Basic usage →Multi-store with server persistence →
Multi-store with no hydration mismatch →