GitHub

Theme Toggle

Toggle button for switching between light and dark themes

Basic Usage

Loading...

Installation

pnpm add @corew500/ui

Usage

import { ThemeToggle } from "@corew500/ui/theme-toggle"

<ThemeToggle>Content</ThemeToggle>

Variants

themeToggleVariants

AxisValuesDefault
size
defaultsmlg
default

API Reference

Props

PropTypeDefaultDescription
sizeenum

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

Related

Related Components