mcpField
T
theme-elements

theme-elements

github.com/crafter-stationDesign & UI52652 installsUpdated 11w ago
Repository

About theme-elements

theme-elements provides six theme-switcher variants for applications using next-themes. Developers can choose among buttons, dropdowns, and toggles, and all variants are hydration-safe by default.

Key features

  1. 01Six theme-switcher variants
  2. 02Button, dropdown, and toggle styles
  3. 03Requires next-themes
  4. 04Hydration-safe variants

Use cases

  1. 01Add a theme control to a navbar
  2. 02Offer theme choices in a settings page

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/crafter-station/elements --skill theme-elements

After installing, type/theme-elementsin Claude Code to confirm it loaded.

Details

From the project README

Theme Switcher Elements

6 theme switcher variants. Requires next-themes (auto-installed).

Install Pattern

npx shadcn@latest add @elements/theme-switcher-{variant}

Variants

VariantInstallDescription
Button@elements/theme-switcher-buttonSimple icon button
Classic@elements/theme-switcher-classicClassic toggle with label
Dropdown@elements/theme-switcher-dropdownDropdown menu with options
Multi-Button@elements/theme-switcher-multi-buttonButton group (Light/Dark/System)
Switch@elements/theme-switcher-switchToggle switch
Toggle@elements/theme-switcher-toggleAnimated toggle

Quick Patterns

# Minimal (navbar icon)
npx shadcn@latest add @elements/theme-switcher-button

# Full control
npx shadcn@latest add @elements/theme-switcher-dropdown

# Settings page
npx shadcn@latest add @elements/theme-switcher-multi-button

Setup

Requires ThemeProvider from next-themes wrapping your app in the root layout:

import { ThemeProvider } from "next-themes";

export default function Layout({ children }) {
  return (
    <ThemeProvider attribute="class" defaultTheme="system" enableSystem>
      {children}
    </ThemeProvider>
  );
}

All variants are hydration-safe by default.

Discovery

Browse https://tryelements.dev/docs/theme

Comments

Markdown supported