Skip to content

Latest commit

 

History

History
78 lines (58 loc) · 2.69 KB

File metadata and controls

78 lines (58 loc) · 2.69 KB

react-theme-select

Reusable React theme picker component.

Jump to the theme gallery.

Install

pnpm add react-theme-select

Usage

import { ThemeSelect, defaultPalettes } from "react-theme-select";

const themes = Object.keys(defaultPalettes);

<ThemeSelect
  theme={theme}
  setTheme={setTheme}
  availableThemes={themes}
/>

This component expects CSS variables for --background, --surface, --text, --border, --primary, --success, --warning, --danger, --info, and optionally --muted.

See examples/basic/README.md for a full working snippet.

Build

pnpm run build

The build outputs ESM to dist/ and copies the CSS module alongside the JS output.

Theme gallery

Generate screenshots with:

pnpm run screenshots

If Playwright browsers are missing:

pnpm exec playwright install chromium
Show all themes
Hacker theme Dark theme Light theme Ocean theme Dim theme Amoled theme Dracula theme Nord theme Gruvbox theme Solarized dark theme Forest theme Sunset theme Cyberpunk theme Sepia theme High contrast theme Runescape theme Runescape stone theme Runescape gold theme Oasis theme Minecraft theme