next-themes is a React theme abstraction for Next.js that helps you implement dark mode with a small setup. It supports system preference via prefers-color-scheme, prevents theme flashing on load (SSR and SSG), and can sync the active theme across tabs and windows using a ThemeProvider and a useTheme hook.
Project status
- Maintenance status: The repo shows some recent activity (last upstream push on 2026-02-25), but the most recent published updates tag are from v0.4.6 on 2025-03-11, which is more than a year ago relative to today (2026-06-09). Overall, this looks more like maintenance mode than active evolution.
- Update cadence: Historically, updates came in clustered bursts around 2024-11 and early 2025, then slowed considerably after v0.4.6. There have been no newer tagged updates since March 2025, despite the Feb 2026 upstream push.
AI summary generated
Recent updates
v0.4.6
This patch release primarily fixes a runtime edge case in the theme script update logic when the optional value mapping is missing or null. The code now guards access to value[theme] to prevent errors and visible flashing. A small packaging metadata change is also present in package.json.
v0.4.5
v0.4.5 updates how next-themes resolves and applies themes, and tweaks CI tooling. It maps theme values to class names correctly in the injected script and pre-computes the resolved theme to reduce extra renders. The release notes also mention updating Next.js and fixing corepack-related CI failures.
v0.4.4
Release v0.4.4 contains a fix aimed at preventing an infinite loop that could cause theme flickering. The code change specifically alters how the library responds to the browser "storage" event, plus a minor README link text change.
v0.4.3
v0.4.3 adds support for passing the provided `nonce` prop onto the inline style tag used by `disableTransitionOnChange` (to support stricter CSP configurations). The implementation also updates the effect to react to `nonce` changes, and the repo updates PostCSS from 8.4.28 to 8.4.31 in example projects and the lockfile.
Featuresv0.4.2
v0.4.2 primarily re-exports type definitions from the library entrypoint. The code diff also updates the example applications to use a newer Next.js version, which is not mentioned in the release notes.
Featuresv0.4.1
v0.4.1 adds support for multiple theme attributes in the injected inline script, and introduces a new `scriptProps` prop that lets users pass attributes to the injected `<script>` tag (for example to work with Cloudflare Rocket Loader). The release notes also include documentation updates for TailwindCSS >3.4.1 and a README snippet about dynamic client-side loading to avoid hydration mismatch.
Featuresv0.4.0
v0.4.0 refines next-themes' ThemeProvider behavior with improved inline script minification, fixes for typing and functional updates to setTheme, and adds support for multiple attributes. It also expands peer dependency support to include React 19.
Featuresv0.3.0
This release (v0.3.0) focuses on making next-themes consumable directly from React Client Components by adding a top-level "use client" directive. The code diff also includes broader refactors around types, testing/build tooling, and module packaging outputs.
BreakingFeaturesv0.2.0
v0.2.0 makes a small set of mildly breaking changes to how the library injects its script into the page. It also fixes multiple issues, including undefined references in the injected script, and restores compatibility with CSP nonces by no longer using base64-encoded script contents.
BreakingSecurity