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

    596
  • Animated Text

    Animated Text

    219
  • Animated Tabs

    Animated Tabs

    93
  • Animated Counter

    Animated Counter

    83
  • Slider

    Slider

    57

More in Forms

View all
  • Premium Auth

    Premium Auth

    555
  • Form

    Form

    17
  • Contact Card

    Contact Card

    1.1K
  • Authentication Card

    Authentication Card

    51
  • Book A Demo 1

    Book A Demo 1

    87
  • Login 1

    Login 1

    61
  • SignInPage

    SignInPage

    736
  • Login Card

    Login Card

    33