Mode Toggle
Animated sun ⇄ moon light/dark toggle icon-button.
Import
tsx
import { ModeToggle } from "@cooud-ui/ui";
bash
npx cooud-ui add mode-toggle
Examples
API Reference
Generated from the component's exported types.
ModeToggleProps
Extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, "children">
| Prop | Type | Default | Description |
|---|---|---|---|
mode* | ModeToggleMode | — | The current color mode. The component is fully controlled — it never stores mode itself. |
onModeChange* | (next: ModeToggleMode) => void | — | Called with the opposite mode when the button is activated (click, Enter or Space). |
size | ModeToggleSize | "md" | Button footprint: `sm` (32px, 16px glyph) or `md` (36px, 20px glyph). Defaults to `md`. |