---
title: "Realistic Switch | Free React & Tailwind Craft Component | Motion UI"
canonical: "https://blacknest.dev/motion/c/craft/realistic-switch"
github_source: "https://github.com/Rkj0123/motion-ui-skill/blob/main/components/buttons/realistic-switch.tsx"
install_command: "npx motion-ui-skill add realistic-switch"
dependencies: ["clsx","motion","react","tailwind-merge"]
category: "craft"
subcategory: "buttons"
---

# Realistic Switch

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

## Install

```bash
npx motion-ui-skill add realistic-switch
```

## Dependencies

- `clsx`
- `motion`
- `react`
- `tailwind-merge`

## Usage

```tsx
"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 |

## Source Files

- [components/buttons/realistic-switch.tsx](https://github.com/Rkj0123/motion-ui-skill/blob/main/components/buttons/realistic-switch.tsx)
- [lib/utils.ts](https://github.com/Rkj0123/motion-ui-skill/blob/main/lib/utils.ts)
