Skip to main content

Installation

Usage

Examples

Basic

A simple toggle button with an icon.

With Text

Toggle button with both icon and text.

Variants

    Sizes

    Disabled

    Controlled

    Component Code

    Props

    Toggle

    Accessibility

    • Uses the button role with aria-pressed attribute
    • Keyboard accessible (Space/Enter to toggle)
    • Always include an aria-label for icon-only toggles
    • Disabled state prevents interaction and is announced to screen readers

    API Reference

    Built on top of Radix UI Toggle. See the official API documentation for more details.