Get Started
Components
- Accordion
- Alert Dialog
- Alert
- Aspect Ratio
- Avatar
- Badge
- Breadcrumb
- Button Group
- Button
- Card
- Carousel
- Checkbox
- Collapsible
- Combobox
- Command
- Container
- Context Menu
- Data Table
- Dialog
- Drawer
- Dropdown Menu
- Empty
- Field
- Flex
- Form
- Grid
- Hero Button
- Hover Card
- Input Group
- Input OTP
- Input
- Item
- Kbd
- Label
- Menubar
- Native Select
- Navigation Menu
- Pagination
- Popover
- Progress
- Radio Group
- Resizable
- Responsive
- Scroll Area
- Segmented Control
- Select
- Separator
- Sheet
- Sidebar
- Skeleton
- Slider
- Sonner
- Spacer
- Spinner
- Squircle
- Switch
- Table
- Tabs
- Textarea
- Theme Toggle
- Toggle Group
- Toggle
- Tooltip
- Typography
- Unicorn Wrapper
Animations
- Background Image Parallax
- Card Swipe Carousel
- Cards Parallax
- Parallax Scroll
- Perspective Carousel
- Perspective Section Transition
- Scroll Expand
- Scroll Fade
- Scroll Scale
- Slide Down
- Slide Up
- Smooth Parallax Scroll
- Smooth Scroll
- Sticky Footer
- Text Along Path
- Text Gradient Opacity
- Text Parallax
- Transforms 3d
- Zoom Parallax
A compact toggle component for switching between light, dark, and system themes.
"use client"
import { ThemeToggle } from "@/components/ui/theme-toggle"
export function ThemeToggleDemo() {
return (
<div className="flex items-center justify-center">
<ThemeToggle />
</div>
)
}
Installation
pnpm dlx pitsi@latest add theme-toggle
Usage
import { ThemeToggle } from "@/components/ui/theme-toggle"<ThemeToggle />Examples
Default (Light, Dark, System)
"use client"
import { ThemeToggle } from "@/components/ui/theme-toggle"
export function ThemeToggleDemo() {
return (
<div className="flex items-center justify-center">
<ThemeToggle />
</div>
)
}
Light-Dark Only
Use the mode prop to show only light and dark options without system.
<ThemeToggle mode="light-dark" />Props
ThemeToggle
Extends all props from HTMLDivElement.
| Prop | Type | Default | Description |
|---|---|---|---|
mode | "light-dark" | "light-dark-system" | "light-dark-system" | Whether to show system option or just light/dark |
Features
- Smooth animated transitions between theme changes
- Compact design with icon-only buttons
- Built on next-themes for theme management
- Supports light, dark, and system preferences
- Accessible keyboard navigation
- Hydration-safe with proper mounting checks
- Customizable with className prop