Manu Arora

Framer Motion Switch

Component 111

About

A smooth animated toggle switch built with Framer Motion. The thumb morphs and slides with a liquid animation effect.

Built with React and Tailwind. Copy the prompt and paste it into Claude Code, Cursor or Lovable: your agent adds Framer Motion Switch to your project and fits it to your theme.

Code

How Framer Motion Switch is used: the demo's code. The component's own source comes with a free account.

Usage.tsx

"use client";
import React, { useState } from "react";
import { Switch } from "../components/ui/framer-motion-switch";

export default function FramerMotionSwitchDemo() {
  const [checked, setChecked] = useState(false);
  return (
    <div className="flex flex-col items-center justify-center w-full min-h-screen bg-black gap-8 p-8">
      <Switch checked={checked} setChecked={setChecked} />
      <Switch checked={!checked} setChecked={(v) => setChecked(!v)} />
    </div>
  );
}

Dependencies

More by Manu Arora

View all
  • Container Scroll Animation

    Container Scroll Animation

    10.2K
  • Glowing Effect

    Glowing Effect

    4.4K
  • Aurora Background

    Aurora Background

    4.4K
  • Timeline

    Timeline

    4.3K
  • Sparkles

    Sparkles

    4.1K
  • Lamp

    Lamp

    3.7K
  • Sidebar

    Sidebar

    3.6K
  • Bento Grid

    Bento Grid

    2.7K