Components / Cards
Reveal Card
An image card whose details slide up smoothly on hover or focus.
Glacier Lake
Hover to reveal
A three-day hike through alpine meadows to a turquoise lake fed by ancient ice. Best from July to September.
Installation
Requires React 18+ and Tailwind CSS.
- 1
Install dependencies
$ npm install motion - 2
Add the component
Copy the code from the Code tab above into
components/ui/reveal-card.tsx. - 3
Use it
example.tsximport { RevealCard } from "@/components/ui/reveal-card"; export default function RevealCardDemo() { return ( <RevealCard cover="linear-gradient(160deg, #38bdf8 0%, #6366f1 55%, #1e1b4b 100%)" title="Glacier Lake" subtitle="Hover to reveal" > A three-day hike through alpine meadows to a turquoise lake fed by ancient ice. Best from July to September. </RevealCard> ); }
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| cover | string | — | Any CSS background (color, gradient or url()). |
| title | ReactNode | — | Always-visible title. |
| subtitle | ReactNode | — | Optional line under the title. |
| children | ReactNode | — | Content revealed on hover. |
| className | string | "h-80 w-64" | Card size. |