Skip to Content

toggle

ui

A two-state button that can be either on or off.

Use cases

  • Formatting toolbar buttons (bold, italic, etc.)
  • View mode switches
  • Feature toggles

Variants & sizes

Variants

defaultoutline

Sizes

defaultsmlg

Features

  • Pressed/unpressed state
  • Keyboard accessible
  • Works standalone or in ToggleGroup

Preview

Interactive preview with light/dark mode toggle. Switch to Code tab to view the full source.

Installation

npx shadcn@latest add https://registry.mukoko.com/api/v1/ui/toggle

Dependencies

class-variance-authorityradix-ui

API

Fetch this component's metadata and source code from the registry API.

GET/api/v1/ui/toggle

Source

components/ui/toggle.tsx