media contract

ThemeToggle

Light / Dark / System tri-state toggle. Lives in the header or settings.

Variants

  • icon
  • segmented

Sizes

  • md
  • lg

Example

<ThemeToggle variant="segmented" value={theme} onChange={setTheme} />

Usage rule

Persist choice in localStorage under "windcraft:theme".

The full ThemeToggle contract has 4 more rules, plus the do-not patterns. Get the full recipe.

Get the ThemeToggle contract in your project.