millaistudio

M Switch

Forms

About

A controlled toggle switch (checkbox styled as an iOS-style switch) with an optional label, ported from the Millai UI Vue component library.

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

Code

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

Usage.tsx

"use client";

import * as React from "react";
import MSwitch from "@/components/ui/mswitch";

export default function MSwitchDemo() {
  const [wifi, setWifi] = React.useState(true);
  const [bluetooth, setBluetooth] = React.useState(false);
  const [notifications, setNotifications] = React.useState(true);

  return (
    <div className="flex flex-col gap-4">
      <MSwitch checked={wifi} onCheckedChange={setWifi}>
        Wi-Fi
      </MSwitch>
      <MSwitch checked={bluetooth} onCheckedChange={setBluetooth}>
        Bluetooth
      </MSwitch>
      <MSwitch checked={notifications} onCheckedChange={setNotifications}>
        Notifications
      </MSwitch>
      <MSwitch disabled defaultChecked>
        Airplane Mode (disabled)
      </MSwitch>
    </div>
  );
}

More by millaistudio

View all
  • M Button

    M Button

  • MListItem

    MListItem

  • MBadge

    MBadge

  • MCard

    MCard

  • Side Panel Item

    Side Panel Item

  • MText Input

    MText Input

  • Tab Bar Item

    Tab Bar Item

  • Navigation View

    Navigation View

More in Forms

View all
  • Premium Auth

    Premium Auth

    518
  • Contact Card

    Contact Card

    1K
  • Book A Demo 1

    Book A Demo 1

    72
  • Login 1

    Login 1

    52
  • Authentication Card

    Authentication Card

    48
  • Form

    Form

    16
  • Login Card

    Login Card

    6
  • Modern & Stunning sign in

    Modern & Stunning sign in

    1.6K