Tilt Card
A product card that tilts toward the pointer, with an image zoom and space for product notes.
- Dependencies
- motion
- Size
- 151 lines
- Controls
- 7 controls
Installation
CLI · shadcn registry
npx shadcn@latest add https://ui.onycx.dev/r/tilt-card.json1 · Dependencies
npm install motion2 · Copy the source
components/onycx/tilt-card.tsx
Requires React 19 and Tailwind CSS v4. Copy the source from the tilt-card.tsx tab after tweaking: your values are baked in as the new defaults. Exported image examples use portable sample artwork. Replace it with your own media as needed.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| image / imageAlt | string | "/media/fragrance-showcase/zeta1.webp" | 4:5 photograph and its alt text. The default points to /media/...; replace it with your own image. |
| title / tagline | string | "Zeta" / "Amber power, cut in gold." | Serif title and the italic gold line. |
| tag / index | string | "Men" / "01" | Mono labels on the image corners; empty hides them. |
| tags | string[] | ["Amber", "Wood", "Intense"] | Hairline chips. |
| family / ctaLabel | string | "Amber Woody" / "View" | Footer row above a gold/10 rule. |
| href | string | — | Renders the card as one link labelled 'title — tagline'. |
| maxTilt | number | 2 | Largest rotation in degrees at the card's edges. |
| glow / accent | string | "#b56a22" / "#c8ae80" | Hover glow colour (drawn at 20%) and the gold for tagline, link and hover border. |