Theme Toggle
Basic Usage
Loading...
Installation
pnpm add @corew500/uiUsage
import { ThemeToggle } from "@corew500/ui/theme-toggle"
<ThemeToggle>Content</ThemeToggle>Variants
themeToggleVariants
| Axis | Values | Default |
|---|---|---|
| size | defaultsmlg | default |
API Reference
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| size | enum | — | — |
Accessibility
Keyboard Navigation
- - Uses a `<button>` element for keyboard accessibility
- Focusable and activatable via Enter/Space keys
Screen Readers
- Includes `aria-label` describing the action ("Switch to light/dark theme")
- Screen reader text announces the current action
Localization
Translatable Content
- - The `aria-label` is in English; override via the `aria-label` prop for i18n