GitShow/pacocoursey/next-themes
pacocoursey

next-themes

Perfect Next.js dark mode in 2 lines of code. Support System preference and any other theme with no flashing

by pacocoursey
dark-modedark-themenextjsreactthemes
Star on GitHubForkWebsitenpm

TypeScript

6.3k stars255 forks38 contributorsQuiet · 6mo agoSince 2020v0.4.6MIT

Meet the team

See all 38 on GitHub →
pacocoursey
pacocoursey71 contributions
trm217
trm21711 contributions
BlankParticle
BlankParticle5 contributions
dependabot[bot]Bot
dependabot[bot]4 contributions
brunocrosier
brunocrosier2 contributions
0xflotus
0xflotus1 contribution
Unsleeping
Unsleeping1 contribution
amrhassab
amrhassab1 contribution

Languages

View on GitHub →
TypeScript100%

Commit activity

Last 12 weeks · 0 commits

Full graph →

Community health

2 of 6 standards met

Community profile →
42
✓README✓License○Contributing○Code of Conduct○Issue Template○PR Template

Recent PRs & issues

Quiet · Last activity 6mo ago
See all on GitHub →
EduardF1
fix: replace typeof window with typeof document for Node.js 25+ SSR compatibilityOpenPR

Problem Node.js 25+ ships an experimental Web Storage API that aliases to . This breaks on Node.js 25+ because the SSR guard evaluates at module load time: This causes: on the server calls on the server nonce rendered empty during SSR on startup Reported in #389. Fix Replace with . is a browser-only API — Node.js does not expose it, even in v25+. This is a reliable cross-version SSR guard: Changes — 2 occurrences updated Testing Tested on Node.js v24.15.0, pnpm v10.32.1.

EduardF1 · 4d ago
Soohimi
fix: treat Node 25 window=globalThis as server in SSR guardOpenPR

Fixes #389 Node 25 aliases to , so is false on the server and calls . Use as well: Also use for the nonce check in instead of a raw .

Soohimi · 1w ago
Victor-Zarzar
[Bug]: Script tag while rendering React component.OpenIssue

What happened? A bug encontred! Nextjs 16.2.1 Issue: Encountered a script tag while rendering React component. Scripts inside React components are never executed when rendering on the client. Consider using template tag instead (https://developer.mozilla.org/en-US/docs/Web/HTML/Element/template). Version 0.4.6 What browsers are you seeing the problem on? Google-Chrome, Safari, Orion.

Victor-Zarzar · 2w ago

Recent fixes

View closed PRs →
gavrilikhin-d
[Feature request]: consent managmentClosedIssue

What feature would you like to see? According to GDPR and ePrivacy, you may not persist theme data without a consent (Usually themes go under "preference" consent category, which isn't essential). Can you, please, add a way to pass this consent to next-themes?

gavrilikhin-d · 1mo ago
Structured data for AI agents

Repository: pacocoursey/next-themes. Description: Perfect Next.js dark mode in 2 lines of code. Support System preference and any other theme with no flashing Stars: 6336, Forks: 255. Primary language: TypeScript. Languages: TypeScript (100%). License: MIT. Homepage: https://next-themes-example.vercel.app/ Topics: dark-mode, dark-theme, nextjs, react, themes. Latest release: v0.4.6 (1y ago). Open PRs: 23, open issues: 46. Last activity: 6mo ago. Community health: 42%. Top contributors: pacocoursey, trm217, BlankParticle, dependabot[bot], brunocrosier, 0xflotus, Unsleeping, amrhassab, andreacassani, arturbien and others.

·@ofershap

Replace github.com with gitshow.dev