Realistic Switch

Realistic Switch: Latching physical push switch that sinks into a recessed socket, stays down with an internal glow, and pops up. Free MIT React & Next.js source with Motion and Tailwind CSS, live preview, CLI install and docs.

Install Realistic Switch

npx motion-ui-skill add realistic-switch

Components install as source into your project. The interactive page also includes preview, code, documentation and install tabs.

Dependencies

  • clsx
  • motion
  • react
  • tailwind-merge

Source files

Realistic Switch

Latching physical push switch that sinks into a recessed socket, stays down with an internal glow, and pops up.

Install

npx motion-ui-skill add realistic-switch

Dependencies

  • clsx
  • motion
  • react
  • tailwind-merge

Usage

"use client";

import { RealisticSwitch } from "@/components/buttons/realistic-switch";

export function RealisticSwitchDemo() {
  return (
    <div className="flex items-center justify-center p-6">
      <RealisticSwitch>Click Me</RealisticSwitch>
    </div>
  );
}

API Reference

RealisticSwitch

Prop Type Default Required Description
checked boolean false No Controlled switch state
onCheckedChange (checked: boolean) => void — No State change handler
className string — No Additional CSS classes

Browse this category