Installation
The tweakcn Theme Picker is distributed as a shadcn/ui registry package. Installation is a two-step process:- Install the theme system (components + config)
- Add individual themes you want to use
Prerequisites
Before installing, make sure you have:- A project with shadcn/ui configured
- Node.js 16+ installed
- A package manager (npm, yarn, or pnpm)
If you haven’t set up shadcn/ui yet, follow the shadcn/ui installation guide for your framework first.
Framework-specific guides
Choose your framework to see detailed installation instructions:Next.js
Install for Next.js App Router with next-themes
Vite
Set up in Vite + React projects
Astro
Configure for Astro with React islands
Remix
Install with Remix SSR support
Quick install
For a quick overview, here’s the basic installation flow:Install theme system
Run the framework-specific command to install the theme system:This installs:
ThemeProvidercomponentThemeSwitchercomponent (orModeTogglefor Astro/Remix)themes-config.tsconfiguration file- Base CSS files and all 43 theme stylesheets
What gets installed
The theme system installation adds these files to your project:Components
components/theme-provider.tsx- React context provider for theme statecomponents/theme-switcher.tsx- Dropdown UI for selecting themes (Next.js/Vite)components/mode-toggle.tsx- Light/dark mode toggle (Astro/Remix)
Configuration
lib/themes-config.ts- Theme metadata and configurationlib/sessions.server.ts- Server-side session storage (Remix only)
Styles
styles/themes/index.css- Base theme CSS and importsstyles/themes/{theme-name}.css- Individual theme stylesheets (43 files)
Actions (Remix only)
app/routes/action.set-theme.ts- Server action for theme persistence
Dependency installation
The shadcn CLI automatically installs required dependencies:- Next.js/Vite:
next-themesfor theme management - Remix:
remix-themesfor SSR-compatible theming - All frameworks: shadcn/ui components (dropdown-menu, scroll-area, button)
Next steps
Next.js guide
Detailed Next.js installation with examples
Vite guide
Complete Vite setup instructions
Theme Provider
Configure the ThemeProvider component
Browse themes
Explore all 43 available themes
Troubleshooting
CSS not loading
CSS not loading
Make sure you’ve imported the theme CSS in your root layout:For Next.js, this should be in
app/layout.tsx. For Vite, add it to src/main.tsx.Theme not switching
Theme not switching
Verify that:
- Your
<html>tag hassuppressHydrationWarningattribute - The
ThemeProviderwraps your entire app - You’re using the correct theme naming format:
{name}-lightor{name}-dark
shadcn CLI not found
shadcn CLI not found
Install the shadcn CLI globally:
TypeScript errors
TypeScript errors
Make sure your For Next.js, use
tsconfig.json includes the path aliases:["./app/*", "./components/*"] if needed.