Skip to content

Zoom Card

Media frame whose content zooms slowly on hover, with an optional caption.

$npx shadcn@latest add https://framebrick.co/r/zoom-card.json

From the Nitip template, see it in context.

Examples

Greyscale

The photos rest at half grey and take their colour on hover and keyboard focus; they do not grow.

<ZoomCard href="/work/harbour" grayscale={0.5} zoom={1} caption="Harbour">…</ZoomCard>

Ease-in

The photo settles from 105% to 100% on an ease-in: it barely moves at first, then arrives.

<ZoomCard href="/work/aurora" rest={1.05} zoom={1} ease="in" caption="Aurora — brand site">…</ZoomCard>

Installation

$ npx shadcn@latest add https://framebrick.co/r/zoom-card.json

Usage

import { ZoomCard } from "@/components/ui/zoom-card";

<ZoomCard href="/work/aurora" caption="Aurora — brand site" cursor="View project" className="aspect-[4/3]">
  <Image src={cover} alt="" fill className="object-cover" />
</ZoomCard>

Props

PropTypeDefaultDescription
childrenReactNode—The media: an image, a video, anything. It is stretched to the frame and clipped.
hrefstring—Makes the whole card a Next.js link.
captionReactNode—Shown over the bottom of the frame on a gradient; it also names the link.
labelstring—Names the link when there is no caption and the media's alt text is empty.
zoomnumber1.05Scale at the end of the hover.
restnumber1Scale at rest. Above `zoom` (1.05 against 1) it runs the other way: the image sits enlarged and settles as you point at it.
grayscalenumber0How grey the photo is at rest, from 0 to 1 (Brickfolio: 0.5). It takes its full colour on hover and keyboard focus. Put zoom={1} to keep the photo from growing.
ease"out" | "in""out"The curve of the hover: "out" starts fast and settles (cubic-bezier(0.12, 0.23, 0.5, 1)); "in" starts slowly and ends fast (cubic-bezier(0.5, 0, 0.88, 0.77), Cerette). Both take 400 ms.
cursorstring—Label for <LabelCursor /> (sets data-cursor).
  • grayscale is Brickfolio's project and post cards (and Marai Neesu's product card, grey 50% to full colour with a 105% zoom): the photo sits at that much grey and takes its colour on hover and keyboard focus at the same time as the zoom; in Brickfolio it does not grow (zoom={1}). Framer runs it on spring 500 / 60; the 400 ms tween of this component stands in, as it does for the zoom. The filter is on the photo's own layer, not the frame, so the caption stays white. Filter is not a transform, so MotionConfig would not skip it, but this is plain CSS with motion-reduce:transition-none, which covers the filter too: with reduced motion the colour changes at once. At 0 nothing is added, and the markup and classes are as they were.
  • ease="in" is Cerette's project cards (105% to 100%, 400 ms ease-in): at 117 ms Framer's photo has barely moved (283.5 to 282.6 px of 270), where the ease-out is more than half way.
  • The zoom uses Framer's own tween — cubic-bezier(0.12, 0.23, 0.5, 1) over 400 ms — not a spring.
  • Keyboard focus zooms too; reduced motion turns the transition off.

AI prompt

Paste into v0, Lovable, Bolt or Claude to rebuild this component in your own project.

Create a React + Tailwind CSS component called ZoomCard (no animation library needed).
- A rounded-lg frame with overflow-hidden and bg-muted that stretches its children to fill it.
- A grayscale prop (0 to 1, default 0): above 0 the inner layer also has grayscale-(--gray) with --gray set inline, transition-[transform,filter], and group-hover:grayscale-0 and group-focus-visible:grayscale-0, so the photo takes its colour with the zoom; at 0 add nothing. The caption is outside that layer, so it stays white. motion-reduce:transition-none covers the filter.
- On hover or keyboard focus of the frame, the inner layer scales to 1.05 with transition-transform,
  duration 400ms and Framer's tween cubic-bezier(0.12, 0.23, 0.5, 1); motion-reduce turns the transition off.
- Optional caption absolutely positioned across the bottom on a gradient from black/70 to transparent,
  p-4, text-sm font-medium text-white, pointer-events-none.
- If an href is given, the frame is a Next.js Link with a visible focus ring; a "cursor" prop sets data-cursor
  for a custom cursor component.

Be the first to know

Get new templates and components first

One short email when we release a template or a free component. No spam — unsubscribe anytime.

We use your email only for Framebrick updates. Privacy policy