Rise Card
A photo card with a panel that rises under its name when you point at it or tab into it.
$npx shadcn@latest add https://framebrick.co/r/rise-card.jsonFrom the Fitbricks template, see it in context.

Daniel ReyesHead coach
Strength and mobility, ten years on the floor.
Book a sessionimport { RiseCard } from "@/components/ui/rise-card";
// Demo portrait from Unsplash (free under the Unsplash License), served by this site so no request leaves it.
/* Point at the card, or tab to the button: the panel rises and pushes the name and the role up. On a touch screen the panel is always shown. */
export default function RiseCardDemo() {
return (
<RiseCard
className="w-52"
ratio="4 / 5"
media={<img src="/demo/photo-tabs-daniel.webp" alt="" />}
panel={
<div className="flex flex-col items-start gap-2">
<p className="text-foreground/75">Strength and mobility, ten years on the floor.</p>
<a href="#" className="rounded-md bg-primary px-3 py-1.5 text-xs font-medium text-primary-foreground outline-none focus-visible:ring-[3px] focus-visible:ring-ring/50">
Book a session
</a>
</div>
}
>
<span className="font-medium">Daniel Reyes</span>
<span className="text-sm text-white/85">Head coach</span>
</RiseCard>
);
}Installation
$ npx shadcn@latest add https://framebrick.co/r/rise-card.json1. Install the dependencies.
npm install motion clsx tailwind-merge2. Add
cn()tolib/utils.ts(skip if shadcn already created it).import { clsx, type ClassValue } from "clsx"; import { extendTailwindMerge } from "tailwind-merge"; /* tailwind-merge must know the site's type scale (globals.css) is a font size, not a text color — otherwise cn("text-h6 text-muted-foreground") drops text-h6. */ const twMerge = extendTailwindMerge({ extend: { classGroups: { "font-size": [{ text: ["display", "h1", "h2", "h3", "h4", "h5", "h6"] }] } }, }); export function cn(...inputs: ClassValue[]) { return twMerge(clsx(inputs)); }3. Copy the component into
components/ui/rise-card.tsx.import * as React from "react"; import { cn } from "@/lib/utils"; /* * Rise Card — a photo card with its name and role at the foot, and a panel waiting under them that rises when the card is pointed at * or the keyboard reaches something inside it, pushing the name and the role up (from the Fitbricks trainer card: a white panel with * a summary and a button, 150px under the card at rest). The same rise is Fitbricks' "See Details" pill on its club and program cards * and the quote on its testimonial cards, so what is in the panel is yours: text, a button, a link. * * It is plain CSS — no animation library, no JavaScript — so it works as it is on a server page. The panel is a grid row that goes from * 0fr to 1fr, so the card makes room for it, with the photo behind: the rows grow, the name and role are pushed up, and nothing is * measured. Framer's tween for it is 0.4s on cubic-bezier(0.44, 0, 0.56, 1), kept here (a tween, not a spring: the panel does not * overshoot). Hover only applies where the device can hover; a screen that cannot hover (touch) shows the panel all the time, so it is * never out of reach. Keyboard focus anywhere in the card brings it up, and the panel is in the page at rest, clipped, so a link or a * button in it can be reached with Tab, which is what brings it up. With reduced motion it changes at once (motion-reduce:transition-none). * * The photo is decoration (alt=""). The card itself is not a link, because the panel may hold one: put a link round the name * (give it after:absolute after:inset-0 to make the whole card its target) and the button or link in the panel above it. */ const tween = "duration-400 ease-[cubic-bezier(0.44,0,0.56,1)] motion-reduce:transition-none"; export type RiseCardProps = { /** The photo: an image with an empty alt text, stretched to the card. */ media: React.ReactNode; /** At the foot of the card, always shown: the name and the role. */ children: React.ReactNode; /** The panel that rises: a summary and a button, say. */ panel: React.ReactNode; /** Proportions of the card, as a CSS aspect-ratio value. */ ratio?: string; className?: string; /** Classes for the panel: its look (a card on the photo by default). */ panelClassName?: string; }; export function RiseCard({ media, children, panel, ratio = "3 / 4", className, panelClassName }: RiseCardProps) { return ( <div style={{ aspectRatio: ratio }} className={cn("group/rise relative isolate overflow-hidden rounded-xl bg-muted text-white", className)} > <div className="absolute inset-0 -z-10 [&>*]:size-full [&>*]:object-cover">{media}</div> <div className="absolute inset-x-0 bottom-0 flex flex-col bg-gradient-to-t from-black/75 via-black/40 to-transparent p-4 pt-16"> <div className="flex flex-col">{children}</div> <div className={cn( "grid grid-rows-[0fr] opacity-0 transition-[grid-template-rows,opacity,margin]", tween, "[@media(hover:hover)]:group-hover/rise:mt-3 [@media(hover:hover)]:group-hover/rise:grid-rows-[1fr] [@media(hover:hover)]:group-hover/rise:opacity-100", "group-focus-within/rise:mt-3 group-focus-within/rise:grid-rows-[1fr] group-focus-within/rise:opacity-100", "[@media(hover:none)]:mt-3 [@media(hover:none)]:grid-rows-[1fr] [@media(hover:none)]:opacity-100", )} > <div className="min-h-0 overflow-hidden"> <div className={cn("rounded-lg bg-background p-3 text-sm text-foreground", panelClassName)}>{panel}</div> </div> </div> </div> </div> ); }
Usage
import { RiseCard } from "@/components/ui/rise-card";
<RiseCard
ratio="4 / 5"
media={<Image src={trainer.photo} alt="" fill />}
panel={
<>
<p>{trainer.summary}</p>
<a href={trainer.bookingUrl}>Book a session</a>
</>
}
>
<span className="font-medium">{trainer.name}</span>
<span className="text-sm text-white/85">{trainer.role}</span>
</RiseCard>Props
| Prop | Type | Default | Description |
|---|---|---|---|
| media | ReactNode | — | The photo: an image with an empty alt text. It is stretched to the card and cropped. |
| children | ReactNode | — | At the foot of the card, always shown: the name and the role. |
| panel | ReactNode | — | The panel that rises: a summary and a button, a pill, a quote. |
| ratio | string | "3 / 4" | Proportions of the card, as a CSS aspect-ratio value. |
| className | string | — | Classes for the card (its width, say). |
| panelClassName | string | — | Classes for the panel: its look (bg-background and a little padding by default). |
- It is Fitbricks' trainer card: a white panel with a summary and a button waits 150 px under the card and rises on hover and on focus, pushing the name and the role up. The same rise is its "See Details" pill on the club and program cards and the quote on its testimonial cards, so what is in the panel is yours. Framer's tween for it is 0.4 s on cubic-bezier(0.44, 0, 0.56, 1), kept here: a tween, so the panel does not overshoot.
- Plain CSS, no animation library and no JavaScript, so it works as it is on a server page. The panel is a grid row that goes from 0fr to 1fr, so the card makes room for it and the name and the role are pushed up; nothing is measured. Hover only applies where the device can hover; a screen that cannot (touch) shows the panel all the time, so it is never out of reach. With reduced motion it changes at once.
- Keyboard focus anywhere in the card brings the panel up (focus-within). The panel is in the page when it is closed, clipped, so a button or a link in it can be reached with Tab, which is what brings it up. The text in it is read by assistive technology at rest too.
- The card is not a link, because the panel may hold one: put a link round the name, with after:absolute after:inset-0 to make the whole card its target, and the button or link of the panel above it. The photo is decoration (alt=""). The text at the foot is white on a dark gradient; the panel is bg-background with text-foreground, 4.5:1 in the sample themes.
AI prompt
Paste into v0, Lovable, Bolt or Claude to rebuild this component in your own project.
Create a React + Tailwind CSS component called RiseCard — plain CSS, no animation library, no JavaScript, so it works in a server component.
- Props: media, children (the name and role), panel, ratio ("3 / 4"), className, panelClassName. The root is a relative isolate overflow-hidden rounded-xl bg-muted text-white div with the group/rise class and the aspect-ratio from the prop. The photo is an absolute inset-0 -z-10 box whose children are stretched with size-full object-cover.
- At the foot: an absolute inset-x-0 bottom-0 flex-col box with bg-gradient-to-t from-black/75 via-black/40 to-transparent, p-4 pt-16, holding the children, then the panel's container: a grid with grid-rows-[0fr], opacity-0 and transition-[grid-template-rows,opacity,margin] over 400ms with cubic-bezier(0.44,0,0.56,1), motion-reduce:transition-none. It goes to grid-rows-[1fr], opacity-100 and mt-3 on group-hover/rise (inside @media (hover: hover)), on group-focus-within/rise, and always inside @media (hover: none). Inside it a min-h-0 overflow-hidden box holds the panel: rounded-lg bg-background p-3 text-sm text-foreground plus panelClassName.










