millaistudio

M Switch

Forms 7

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
  • MCheckbox

    MCheckbox

    5
  • Tab Bar Item

    Tab Bar Item

    4
  • MListItem

    MListItem

    3
  • Segmented Control

    Segmented Control

    3
  • M Button

    M Button

  • MBadge

    MBadge

  • MCard

    MCard

  • Side Panel Item

    Side Panel Item

More in Forms

View all
  • Contact Form

    Contact Form

    30
  • Form

    Form

    7
  • Premium Auth

    Premium Auth

    607
  • Book A Demo 1

    Book A Demo 1

    94
  • Card Studio

    Card Studio

    48
  • Contact Card

    Contact Card

    1.1K
  • Login 2

    Login 2

    16
  • Paper Plane

    Paper Plane

    30