millaistudio

M Switch

Forms 3

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
  • Tab Bar Item

    Tab Bar Item

    2
  • MCheckbox

    MCheckbox

    2
  • MListItem

    MListItem

    1
  • Segmented Control

    Segmented Control

    1
  • M Button

    M Button

  • MBadge

    MBadge

  • MCard

    MCard

  • Side Panel Item

    Side Panel Item

More in Forms

View all
  • Premium Auth

    Premium Auth

    567
  • Login 2

    Login 2

    12
  • Form

    Form

    139
  • Book A Demo 1

    Book A Demo 1

    90
  • Authentication Card

    Authentication Card

    51
  • Contact Card

    Contact Card

    1.1K
  • Card Studio

    Card Studio

    46
  • Login 1

    Login 1

    62