# pacocoursey/next-themes

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

Repository: https://github.com/pacocoursey/next-themes
Canonical: https://ross.abutalabs.com/products/next-themes
Homepage: https://next-themes-example.vercel.app/
Language: TypeScript
License: MIT
License Family: permissive
Topics: dark-theme, dark-mode, nextjs, react, themes
Last push: 2026-02-25T05:25:42+00:00

## Health v2 (maintenance only)
Score: 65/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 69, release rhythm 40, longevity 100
- inputs: {"age_days": 2153, "days_push": 189, "days_rel": 540, "gap_med": 0.5, "n_releases_24m": 7}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 6333, forks 254 (observed 2026-08-28T04:09:41.813566+00:00)

## What it is
next-themes is a small React library providing theme management for Next.js apps, supporting system preference, custom themes, and flash-free dark mode. It abstracts theme switching with SSR-safe handling in just a couple lines of code.

## Use cases
- add dark mode to a Next.js app
- respect user system color scheme preference
- avoid theme flash on page load
- support multiple custom color themes
- toggle themes with a React hook
- persist theme choice across visits

## When to choose
- you need dark mode in Next.js with no flash of wrong theme
- you want SSR-safe theme switching with minimal setup
- you need system preference detection plus manual override

## When to avoid
- you are not using React or Next.js
- you need complex multi-tenant theming or design token systems
- you use a CSS-in-JS solution with its own theming

## Facets
- artifact type: library
- maturity: stable
- function: theme, state-management, ui-components
- domain: web-development, frontend
- platform: browser
- tags: nextjs, dark-mode, react, theming, system-preference, nodejs, web-server

## Member repositories
- pacocoursey/next-themes (main) score 65

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:09:41.813566+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-29T17:46:09.714677+00:00, confidence not recorded.
  - readme: https://github.com/pacocoursey/next-themes (fetched 2026-08-28T04:09:41.813566+00:00, sha 7bc50defab87)
  - homepage: https://next-themes-example.vercel.app/ (fetched 2026-08-29T08:42:47.153753+00:00, sha 3dac188a0b00)
  - registry_npm: https://registry.npmjs.org/next-themes (fetched 2026-08-29T08:42:47.162677+00:00, sha feeae0d28414)
- Data as of 2026-08-30T08:39:29.467469+00:00.
