# Spatial Push

A new scene physically presses the old one back into the frame.

> 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/spatial-push
```

<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 { SpatialPush } from "@/components/framecn/spatial-push";
```

```tsx
<SpatialPush />
```

## API Reference

### SpatialPush

| Prop                 | Type                                  | Default |
| -------------------- | ------------------------------------- | ------- |
| `from`               | `ReactNode`                           | `-`     |
| `to`                 | `ReactNode`                           | `-`     |
| `direction`          | `"up" \| "down" \| "left" \| "right"` | `"up"`  |
| `transitionStart`    | `number`                              | `-`     |
| `transitionDuration` | `number`                              | `30`    |
| `speed`              | `number`                              | `1`     |
| `fps`                | `number`                              | `30`    |
| `durationInFrames`   | `number`                              | `90`    |
| `className`          | `string`                              | `-`     |

## Notes

  The old scene is pushed back in 3D space while the next scene slides in from
  the chosen `direction`. Use `transitionDuration` to control how long the push
  phase takes.