Theme Toggle

Toggle between light and dark themes with Datastar reactivity.

Installation

CLI

Install the component using the StarUI CLI:

star add theme-toggle

Examples

Dropdown Theme Selector

Common shadcn-style dropdown with Light, Dark, and System options

API Reference

Props

Prop Type Default Description
alt_theme str dark Alternative theme name (usually dark)
default_theme str light Default theme name (usually light)
cls str '' Additional CSS classes