About
An iOS-style toggle switch whose thumb renders as a liquid-glass lens that swells and refracts the backdrop while pressed or dragged.
Built with React and Tailwind. Copy the prompt and paste it into Claude Code, Cursor or Lovable: your agent adds Glass Switch to your project and fits it to your theme.
Code
How Glass 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 { GlassSwitch } from "@/components/ui/glass-switch";
export default function GlassSwitchDemo() {
const [checked, setChecked] = React.useState(false);
return (
<div className="flex min-h-[200px] w-full items-center justify-center bg-background p-10">
<GlassSwitch
checked={checked}
onCheckedChange={setChecked}
aria-label="Toggle setting"
/>
</div>
);
}








