Skip to content

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.json

From the Fitbricks template, see it in context.

Daniel ReyesHead coach

Strength and mobility, ten years on the floor.

Book a session

Installation

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

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

PropTypeDefaultDescription
mediaReactNode—The photo: an image with an empty alt text. It is stretched to the card and cropped.
childrenReactNode—At the foot of the card, always shown: the name and the role.
panelReactNode—The panel that rises: a summary and a button, a pill, a quote.
ratiostring"3 / 4"Proportions of the card, as a CSS aspect-ratio value.
classNamestring—Classes for the card (its width, say).
panelClassNamestring—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.

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