Skip to content

Parallax Card

A card that leans away from your pointer: the surface shifts a few pixels and grows a touch, while its content and media move a little further, so the layers read as depth. It springs back on leave, and holds still on touch screens and with reduced motion.

On this page
Used for
  • Feature tiles
  • Pricing highlights
  • Product shots
  • Landing cards

Examples

Tone
Depth

Installation

npx knowns-ui@latest add parallax-card
For Claude Code, Cursor or Codex: installs it and wires the props to your own data.

Props

tone
"plain" | "muted" | "accent"
Default"plain"
The ground: the card colour, a quiet muted fill, or a light tint of `tint` with a matching hairline.
tint
string
Defaultindigo
The accent tint for tone accent: any CSS colour or a token such as var(--primary).
grain
boolean | number
Defaultfalse
A soft film grain over the ground; a number sets its opacity, 0 to 0.3.
depth
number
Default10
How far the content travels at the card's edge, in px. The surface moves half as much, media about twice the surface.
scale
number
Default1.02
Hover scale of the surface.
media / mediaSide
ReactNode / "right" | "bottom"
Default - / "right"
A screenshot or illustration placed on an edge and bleeding off it. Right moves to the bottom on small screens.
contentClassName
string
Default"p-6 sm:p-8"
Classes for the content layer, e.g. a max width that leaves room for the media.
Motion
-
Transforms only, so no layout shift. One rAF loop runs while hovered or settling and writes transforms directly (no re-renders). Off on touch and coarse pointers and with reduced motion.

What it handles

  1. 01Leans the surface a few pixels away from the pointer and grows it to 102% while the pointer is over it.
  2. 02Moves the content layer and an optional `media` slot further than the surface, so the layers read as depth.
  3. 03Sets how far things travel with `depth` in pixels and how much the surface grows with `scale`.
  4. 04Lets `media` bleed off the `right` or `bottom` edge, with the right edge moving to the bottom on small screens.
  5. 05Picks a ground with `tone` plain, muted or accent, tinted by `tint`, with a static noise tile from `grain`.
  6. 06Uses transforms only and one frame loop that runs while the pointer is over the card or the spring is settling, and stays still for touch and reduced motion.

States

First render
Nothing. The card paints at rest
none
Pointer over the card
The layers follow the pointer with a spring
none
Pointer leaves
The layers spring back to rest
none
Reduced motion or touch
The card stays still
0ms

Works with

When to use

When to use

  • A few feature cards in a bento or a launch section, where a little depth on hover invites a closer look.
  • A card with a product screenshot bleeding off its edge, so the screenshot feels like a window into the app.

When not to use

  • Dense grids, lists or anything people click through quickly: motion on every card gets tiring.
  • Pointing at the one option to choose: use Shine Border.

Using with AI

Use Copy page for AI above to give your assistant this page, Copy prompt under the install command to have it installed and wired to your data, or connect the Knowns UI MCP server and just ask:

  • Add the Knowns UI Parallax Card to my app and wire it to my own data.
  • I need a few feature cards in a bento or a launch section, where a little depth on hover invites a closer look. Set that up with the Knowns UI Parallax Card.
  • Which Parallax Card props do I need for a minimal setup? Show me a short example.

With the server connected, your assistant calls get_component({ name: "parallax-card" }) and search_docs({ query: "parallax card" }).

Need help?

Stuck on Parallax Card, or found something off? We read every message.