pacocoursey/next-themes

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

View on GitHub ↗Jump to charts ↓

Summary Information

Updated 56 minutes ago
Added to GitGenius on September 10th, 2026
Created on October 10th, 2020
Open Issues & Pull Requests: 69 (+0)
GitHub issues: Enabled
Number of forks: 255
Total Stargazers: 6,338 (+0)
Total Subscribers: 18 (+0)

Repository Insights (GitGenius)

Median issue/PR response: 4.2 days
Mean response time: 38.6 days
90th percentile: 87.4 days
Tracked items: 83

How this project is maintained

Around half of the issues opened in the past year never receive a reply. 100% of open issues come from outside the core team, so the backlog reflects real-world use rather than internal planning. Only 0% of issues opened in the past year have been closed. Three people close 87% of everything that gets resolved.

Charts & Analytics

Fetching additional details & charts...

Issue Activity (beta)

Open issues: 40
New in 7 days: 0
Closed in 7 days: 0
Avg open age: 749 days
Stale 30+ days: 37
Stale 90+ days: 32

Recent activity

Opened in 7 days: 0
Closed in 7 days: 0
Comments in 7 days: 0
Events in 7 days: 0

Top labels

  • bug (31)
  • triage (31)
  • request (13)
  • enhancement (9)
  • v1 (4)
  • needs information (2)
  • question (2)
  • documentation (1)

Most active issues this week

Detailed Description

next-themes is a React library that enables theme switching in Next.js applications with minimal setup and no flash of unstyled content.

The library solves the problem of implementing dark mode and theme switching without the visual glitch that occurs when a page loads before the theme preference is applied. It works by persisting theme preferences to storage, reading them before the page renders, and injecting the appropriate styles early in the page lifecycle. This approach prevents the flash of default styling that users typically see when theme detection happens after initial render. The library supports system preference detection as well as custom themes beyond simple dark and light modes.

Developers should choose next-themes if they are building with Next.js and want theme switching with a minimal API surface. It suits projects where avoiding layout shift or color flashing during page load is important for user experience. The library is particularly valuable for applications that need to respect system-level dark mode preferences while also allowing manual theme selection.

The project maintains active engagement with its codebase, regularly addressing issues and pull requests from the community. Development shows consistent responsiveness to user-reported problems and feature requests. The maintainers demonstrate a commitment to keeping the library compatible with current Next.js versions and React patterns.