language-lit

Material 3 Switch

Forms

About

A toggle control rendered as a native checkbox with role="switch" that follows the Material 3 Expressive spec, including pressed-shape motion and an optional icon inside the thumb.

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

Code

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

Usage.tsx

import Switch from "@/components/ui/switch";

export default function DisabledSwitchDemo() {
  return (
    <div className="flex w-full items-center justify-center p-10">
      <div className="flex flex-col gap-3">
        <label className="flex items-center gap-4">
          <Switch disabled />
          <span className="text-base text-[#1d1b20]">Unavailable</span>
        </label>
        <label className="flex items-center gap-4">
          <Switch disabled defaultChecked />
          <span className="text-base text-[#1d1b20]">Unavailable and on</span>
        </label>
      </div>
    </div>
  );
}

More by language-lit

View all
  • Material Text Field

    Material Text Field

  • Material 3 Checkbox

    Material 3 Checkbox

  • Circular Progress

    Circular Progress

More in Forms

View all
  • Premium Auth

    Premium Auth

    524
  • Contact Card

    Contact Card

    1K
  • Book A Demo 1

    Book A Demo 1

    73
  • Form

    Form

    16
  • Login 1

    Login 1

    53
  • Book A Demo 3

    Book A Demo 3

    89
  • Hand-Drawn Checkbox

    Hand-Drawn Checkbox

    48
  • Login Card

    Login Card

    6