# Morphing Modal

Card lifts off a grid and expands into a full-screen modal.

> For the complete documentation index, see [llms.txt](/llms.txt). Markdown variants are available by appending `.md` to any URL or sending an `Accept: text/markdown` header. An agent skill is available at [/.well-known/agent-skills/site-skill.md](/.well-known/agent-skills/site-skill.md).

## Installation

<TabsTrigger value="cli">Command</TabsTrigger>
<TabsTrigger value="manual">Manual</TabsTrigger>

```bash
npx shadcn@latest add @framecn/morphing-modal
```

<Step>Copy and paste the following code into your project.</Step>

<Step>Update the import paths to match your project setup.</Step>

## Usage

```tsx
import { MorphingModal } from "@/components/framecn/morphing-modal";
```

```tsx
<MorphingModal />
```

## API Reference

### MorphingModal

| Prop               | Type                | Default        |
| ------------------ | ------------------- | -------------- |
| `from`             | `MorphingModalRect` | `DEFAULT_FROM` |
| `to`               | `MorphingModalRect` | `DEFAULT_TO`   |
| `borderRadiusFrom` | `number`            | `24`           |
| `borderRadiusTo`   | `number`            | `0`            |
| `morphAt`          | `number`            | `30`           |
| `background`       | `string`            | `"#050505"`    |
| `cardColor`        | `string`            | `"#0a0a0a"`    |
| `textColor`        | `string`            | `"#fafafa"`    |
| `mutedColor`       | `string`            | `"#71717a"`    |
| `source`           | `ReactNode`         | `-`            |
| `modal`            | `ReactNode`         | `-`            |
| `speed`            | `number`            | `1`            |
| `fps`              | `number`            | `30`           |
| `durationInFrames` | `number`            | `180`          |
| `width`            | `number`            | `1280`         |
| `height`           | `number`            | `720`          |
| `className`        | `string`            | `-`            |

## Notes

  The modal uses state to control the expansion animation. The card lifts off
  the grid and expands to full screen with a spring animation.