Animate UI

Toggle

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

Made by imskyleen
Edit on GitHub

Installation

Usage

<Toggle>
  <ToggleHighlight />
  <ToggleItem />
</Toggle>

API Reference

Toggle

Radix UI API Reference - Toggle.Root
PropTypeDefault
...props?
HTMLMotionProps<"button">
-

The asChild property is not supported in the Toggle component, as it is used for animation.

ToggleHighlight

PropTypeDefault
...props?
HTMLMotionProps<"div">
-

ToggleItem

PropTypeDefault
...props?
HTMLMotionProps<"div">
-

Credits

Built by Skyleen. The source code is available on GitHub.