donavon/use-dark-mode
A custom React Hook to help you implement a "dark mode" component. observed · 2026-08-28
Health v2 · maintenance only
32/100
- Activity 0
- Release rhythm 35
- Longevity 100
Flags: no_releases
How is this computed?
round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10) — computed 2026-09-02. Adoption (stars, forks) is never an input.
- gap_med: n/a
- age_days: 2788
- days_rel: n/a
- days_push: 1338
- n_releases_24m: 0
Adoption not part of the score
1282 stars · 95 forks observed · 2026-08-28
What it is AI-extracted, prompt v1, taxonomy v1, 2026-08-30, confidence not recorded
A custom React Hook that implements dark mode toggling for React applications. It persists the user's preference to localStorage, syncs state across tabs, respects the system's prefers-color-scheme setting, and supports SSR.
Use cases
- add a dark mode toggle to a react app
- persist user theme preference in localstorage
- sync dark mode state across browser tabs
- follow system dark mode preference with prefers-color-scheme
- toggle a css class on body for theming
- implement dark mode in a server-side rendered react app
When to choose
- you use React 16.8+ and want a small, focused hook for dark mode
- you want persistence, cross-tab sync, and system preference detection out of the box
- you need SSR support for theme switching
When to avoid
- you don't use React
- you need full theming/design-token management rather than a simple light/dark toggle
- you need a framework-agnostic or vanilla JS solution
Facets
library · maturity maintenance
state-management ui-components theme frontend web-development browser react-hooks dark-mode dark-theme localstorage prefers-color-scheme ssr nodejs
2 sources
- readme: https://github.com/donavon/use-dark-mode · fetched 2026-08-28 · 89033164fdba
- registry_npm: https://registry.npmjs.org/use-dark-mode · fetched 2026-08-29 · 7fa72980749d
Member repositories
| Repository | Role | Health v2 |
|---|---|---|
| donavon/use-dark-mode | main | 32 |
For agents
markdown · JSON · MCP: product_card(name="donavon/use-dark-mode")
Data as of 2026-08-30T08:39:29.467469+00:00 · Report a problem