Skip to example

Base UI: Switch

An example of creating a switch component using Base UI and Motion for React. This examples uses CSS variables, spring and layout animations to animate the switch by switching justify-content.

Not ready? Try 10 Motion+ demos free.

Create a free Motion account to run 10 Motion+ demos live, with their controls. No card needed.