structyl

Toggle

stable

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

Basic usage

Examples

Outline variant

The outline variant pairs well with text editor toolbars.

Toggle variants and sizes

Use Toggle for formatting controls, filters and icon buttons.

Semantic colors

Color prop sets the pressed-state background and text for semantic toggles.

Features

  • Controlled or uncontrolled.
  • Two variants, three sizes.

Installation

bash
pnpm dlx structyl add toggle

API Reference

Toggle API reference

Full props, types, defaults.

View API
Toggle | structyl