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

    607
  • Animated Text

    Animated Text

    226
  • Animated Tabs

    Animated Tabs

    98
  • Animated Counter

    Animated Counter

    85
  • Slider

    Slider

    63

More in Forms

View all
  • Premium Auth

    Premium Auth

    593
  • Contact Form

    Contact Form

    28
  • Form

    Form

    4
  • Login 1

    Login 1

    70
  • Book A Demo 1

    Book A Demo 1

    94
  • Contact Card

    Contact Card

    1.1K
  • HeroUI Field Error

    HeroUI Field Error

    13
  • Form [react-aria-components]

    Form [react-aria-components]

    19