@wrksz/themes

Drop-in replacement for next-themes. React 19 hydration fixed, full TypeScript types, zero dependencies.

Zero dependenciesReact 19 readyTypeScript

Features

What you're getting.

React 19 ready

Fixes the inline script warning, Activity/cacheComponents stale theme, and the __name minification bug.

Drop-in replacement

Same API as next-themes. Change one import.

Hybrid storage

Use storage="hybrid" for cookie-first SSR correctness plus cross-tab sync via localStorage.

Nested providers

Independent theme instances per section. No shared state between them.

Full type safety

createThemes(...) infers your theme union once and types useTheme, useThemeValue, and setTheme everywhere.

Zero runtime deps

No runtime dependencies. A tiny inline script plus React hooks, nothing more.

Comparison

How it compares.

next-themes still has React 19 bugs open.

React 19 script warningFixed
__name minification bugFixed
React 19 Activity / cacheComponents stale themeFixed
Multiple classes per themeFixed
Nested providersYes
sessionStorage supportYes
cookie storage (zero-flash SSR)Yes
Disable storageYes
meta theme-color supportYes
Server-provided themeYes
Always follow system preferenceYes
disableTransitionOnChange per propertyYes
Read theme outside ReactYes
Generic typesYes
Zero runtime dependenciesYes

Roadmap

What's next.

Framework agnostic

Remix, Vite, SvelteKit, and other React-based frameworks.

More features

More storage adapters and finer-grained resolution options.

Open to contributions

Bug reports, feature requests, and PRs are welcome on GitHub.