Theme Toggle Button

Switches between light and dark with next-themes; the sun grows into a moon.

Dependenciesnext-themes

Installation#

pnpm dlx shadcn@latest add @balick/theme-toggle-button

Or pass the full URL: https://ui.balick.me/r/theme-toggle-button.json

Usage#

import { ThemeToggleButton } from "@/components/ui/theme-toggle-button"

export function Header() {
  return <ThemeToggleButton />
}

Props#

PropTypeDefault
variant

Style of the shadcn/ui Button underneath.

Button variant"ghost"
size

Size of the button.

Button size"icon"