# Parallax Card

> A window onto a scene in layers.

Each layer moves against the pointer by its own depth, so the card opens into space. For key art, destinations and album covers.

- Family: Cards
- Plan: Creative. Included with Creative.
- Requires: React, Tailwind CSS v4 and the motion package
- Page with a live preview: https://galactrex.com/ui/parallax-card/
- Licence: https://galactrex.com/ui/license/

## Install

```sh
npx @galactrex/ui login   # once, with an API key from https://galactrex.com/account/
npx @galactrex/ui add parallax-card
```

It installs to `components/galactrex/parallax-card.tsx`, with the shared motion helpers beside it. First time in a project: `npx @galactrex/ui init` (setup guide: https://galactrex.com/docs/ui-components-setup/).

## Usage

```tsx
import { ParallaxCard } from "@/components/galactrex/parallax-card";

<ParallaxCard layers={[{ content: <Sky />, depth: 0.2 }, { content: <Hills />, depth: 0.8 }]} />
```

## Props

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `layers` | `{ content; depth }[]` | — | Back to front; depth 0–1. |
| `children` | `ReactNode` | — | Foreground. |
| `travel` | `number` | `18` | Largest travel in px. |
| `className` | `string` | — | Extra classes for the outer element. |

## Variants

- **Scene.** Sky, mountains, moon.

## Accessibility

- Layers are aria-hidden; put meaning in children.

## Motion

- Spring transforms per layer.
- Still on touch and reduced motion.
