# @theme-ui/color-modes

> Adds support for user-controlled color modes

Latest version **0.17.4** (published 2026-01-02) · MIT license · 0 weekly downloads

## Install

```sh
npm install @theme-ui/color-modes
pnpm add @theme-ui/color-modes
yarn add @theme-ui/color-modes
bun add @theme-ui/color-modes
```

## Health

**Score 55/100 (C)** — status: stable.

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads; pre 1.0.

## Facts

| | |
|---|---|
| Version | 0.17.4 |
| Published | 2026-01-02 |
| First published | 2019-12-31 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 3 |
| Unpacked size | 97.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 5399 |
| Author | Brent Jackson |
| Maintainers | jxnblk, johno, hasparus, lachlanjc |

## Links

- npm: https://www.npmjs.com/package/@theme-ui/color-modes
- Repository: https://github.com/system-ui/theme-ui
- Homepage: https://github.com/system-ui/theme-ui#readme
- Issues: https://github.com/system-ui/theme-ui/issues
- npm.io page: https://npm.io/package/@theme-ui/color-modes

## Dependencies (3)

- [deepmerge](https://npm.io/package/deepmerge.md) ^4.2.2
- [@theme-ui/css](https://npm.io/package/@theme-ui/css.md) ^0.17.4
- [@theme-ui/core](https://npm.io/package/@theme-ui/core.md) ^0.17.4

## Recent versions

- 0.17.4 (latest) — 2026-01-02
- 0.17.2-develop.1 (develop) — 2025-02-14
- 0.16.2-scale-tuples.0 (canary) — 2023-09-26
- 0.6.0-alpha.8 (next) — 2021-03-19
- 0.4.0-highlight.0 (highlight) — 2020-05-08
- 0.17.2 — 2025-02-14
- 0.17.2-develop.0 — 2024-12-18
- 0.17.1 — 2024-10-24
- 0.17.1-develop.0 — 2024-10-24
- 0.17.0 — 2024-10-18
- 0.17.0-develop.1 — 2024-10-18
- 0.17.0-develop.0 — 2024-10-18
- 0.16.2 — 2024-02-19
- 0.16.2-develop.5 — 2024-02-19
- 0.16.2-develop.2 — 2024-01-05
- … 417 more at https://npm.io/package/@theme-ui/color-modes/versions

## README

# @theme-ui/color-modes

Adds support for user-controlled color modes

https://theme-ui.com

**Note:** _This package is included in the main `theme-ui` package, and
generally should not be used on its own._

```sh
npm i @theme-ui/color-modes
```

```jsx
import { ThemeProvider } from '@theme-ui/core'
import { ColorModeProvider } from '@theme-ui/color-modes'
import theme from './theme'

export default (props) => (
  <ThemeProvider theme={theme}>
    <ColorModeProvider>{props.children}</ColorModeProvider>
  </ThemeProvider>
)
```

## API

- `useColorMode`
- `ColorModeProvider`

---
_Source: https://npm.io/package/@theme-ui/color-modes · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
