Beta

Switch

A control that allows the user to toggle between checked and not checked.

We take the Shadcn UI component and animate it with Motion.

Installation

Props

Animate UI props:

PropTypeDefault
leftIcon?
React.ElementType
-
rightIcon?
React.ElementType
-
thumbIcon?
React.ElementType
-
width?
number
40
height?
number
24
margin?
number
2.5

Credits

  • We use Radix UI for the switch component.
  • We take our inspiration from Shadcn UI for the switch style (to make it easier to replace a shadcn component with the animate ui component).

On this page