Theme Toggle Button

A clean icon button theme toggle with rotating Hugeicons sun and moon indicators.

1import { ThemeToggleBtn } from "@/components/theme-toggle-btn";
2 
3export default function ThemeToggleBtnDemo() {
4 return (
5 <div className="flex items-center justify-center p-6">
6 <ThemeToggleBtn />
7 </div>
8 );
9}

Installation

bunx --bun shadcn@latest add https://www.ashutoshtiwari.is-a.dev/r/theme-toggle-btn.json

Usage

1import { ThemeToggleBtn } from "@/components/theme-toggle-btn"
1<ThemeToggleBtn />

API Reference

PropTypeDefaultDescription
classNamestring""

Additional CSS classes applied to the button.

variant"outline" | "ghost" | "default" | "secondary""outline"

Visual button variant from shadcn button component.