Build UI

iOS Animated Switch

Forms 6

About

Recreation of iOS's switch control built with React Aria Components and Tailwind.

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

Code

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

Usage.tsx

import { Switch } from "@/components/ui/ios-animated-switch"
import { useState } from "react"

function SwitchDemo() {
  let [airplaneMode, setAirplaneMode] = useState(false);

  return (
    <div className="text-foreground">
      <Switch isSelected={airplaneMode} onChange={setAirplaneMode}>
        Airplane Mode
      </Switch>
    </div>
  );
}

export default { SwitchDemo };

Dependencies

More by Build UI

View all
  • Filesystem Item

    Filesystem Item

    615
  • Animated Text

    Animated Text

    228
  • Animated Tabs

    Animated Tabs

    101
  • Animated Counter

    Animated Counter

    88
  • Slider

    Slider

    64

More in Forms

View all
  • Form

    Form

    9
  • Contact Form

    Contact Form

    33
  • Contact Card

    Contact Card

    1.1K
  • Premium Auth

    Premium Auth

    615
  • Paper Plane

    Paper Plane

    113
  • Form

    Form

    18
  • Book A Demo 1

    Book A Demo 1

    95
  • Input

    Input

    14