# Floating Card

> Hangs in the air with a shadow that breathes.

Drifts slowly with a slight sway; its ground shadow grows and shrinks with the height. Hover settles it.

- 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/floating-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 floating-card
```

It installs to `components/galactrex/floating-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 { FloatingCard } from "@/components/galactrex/floating-card";

<FloatingCard phase={0.3}>…</FloatingCard>
```

## Props

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `children` | `ReactNode` | — | Content. |
| `float` | `number` | `10` | Drift in px. |
| `duration` | `number` | `5` | Seconds per drift. |
| `phase` | `number` | `0` | Offset, 0–1. |
| `className` | `string` | — | Extra classes for the outer element. |

## Variants

- **Hero pieces.** Several with different phases.

## Accessibility

- Decorative motion.

## Motion

- Transform loop; pauses offscreen.
- Reduced motion: still.
