Skip to content
VenusUI
Get started

Reveal Card

A media card whose details slide up on hover or keyboard focus.

Preview

Installation

npx shadcn@latest add @venusui/reveal-card

Run this in a project set up with shadcn. If you haven’t set it up yet, run npx shadcn@latest init first.

Files added to your project

Paths use the default shadcn aliases. The CLI follows the aliases in your components.json.

  • @/components/ui/reveal-card.tsx

Usage

The code behind the preview above.

reveal-card-demo.tsx

import { RevealCard } from "@/components/ui/reveal-card"

export default function RevealCardDemo() {
  return (
    <RevealCard
      title="Mountain cabin"
      media={<div className="size-full bg-linear-to-br from-muted to-muted-foreground/30" />}
    >
      <p>Two bedrooms, wood stove, and a view of the valley. Available from March.</p>
      <a href="#" className="mt-3 inline-block font-medium text-foreground underline underline-offset-4">
        View details
      </a>
    </RevealCard>
  )
}

API reference

PropTypeDefaultDescription
mediaReactNode—Image, video or illustration at the top. Required.
titleReactNode—Always-visible title. Required.
childrenReactNode—Details revealed on hover or focus. Required.

All <article> props, including className.

Requirements

  • Tailwind CSS v4, with a cn helper at @/lib/utils. Works in Server Components (no JavaScript needed).

Customization

  • The media area is 4:3; change aspect-[4/3] in the file for other ratios.
  • Put a link or button in the details; focusing it reveals the panel for keyboard users.

Accessibility

  • Details are always in the page for screen readers; they are only visually tucked away.
  • The panel opens on keyboard focus, and is always open on touch screens without hover.
  • No sliding when the user prefers reduced motion.

Troubleshooting

Long details are cut off.
The panel is as tall as its content up to the card height. Keep details short, or increase the media aspect ratio.
Unknown registry "@venusui"
Your shadcn CLI couldn’t find the namespace in the shadcn registry index. Use the latest CLI (npx shadcn@latest), install by URL, or register it with its address: npx shadcn@latest registry add @venusui=https://venusui.com/r/{name}.json.
No components.json found
Run npx shadcn@latest init in your project first.
Loading preview

A card that tilts in 3D toward the pointer with spring physics.

Loading preview

A flight boarding pass with a perforated stub and code that flips to the fare and baggage details.

Loading preview

Stacked cards with the next ones peeking out; Next sends the top card to the back.