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

    573
  • Animated Text

    Animated Text

    210
  • Animated Tabs

    Animated Tabs

    85
  • Animated Counter

    Animated Counter

    78
  • Slider

    Slider

    53

More in Forms

View all
  • Premium Auth

    Premium Auth

    496
  • Authentication Card

    Authentication Card

    44
  • Login 1

    Login 1

    52
  • Login 2

    Login 2

    7
  • Form

    Form

    32
  • Card Studio

    Card Studio

    41
  • Form

    Form

    136
  • Login Card

    Login Card

    32