Skip to content
Pattern

Theme toggle

Controlled theme controls with a three-value switch, binary switch, cycle button, and dropdown.

Composition

Three-way choice

  • <ThemeSegmentedSwitch />

Binary choice

  • <ThemeSwitch>
    • <Switch />
    </ThemeSwitch>

Cycle button

  • <ThemeToggle>
    • <Button />
    </ThemeToggle>

Dropdown choice

  • <ThemeDropdown>
    • <DropdownMenu>
      • <DropdownMenuTrigger />
      • <DropdownMenuContent>
        • <DropdownMenuRadioGroup>
          • <DropdownMenuLabel />
          • <DropdownMenuRadioItem />
          </DropdownMenuRadioGroup>
        </DropdownMenuContent>
      </DropdownMenu>
    </ThemeDropdown>

Installation

Registry command
See registry manifest

Usage

Library dependencies

Owned source

This template’s recipe and private support files. Public dependencies stay linked above.

Block recipesrc/registry/blocks/control-ui/theme-toggle.tsx
src/registry/blocks/control-ui/theme-toggle.tsx