Hover Reveal Card
An image card whose caption and action slide up from the bottom on hover or focus.
AI prompt
Create a 4:3 image card, 280px wide, with a neutral gradient placeholder as the image and rounded 14px corners with overflow hidden. At rest only the image is visible. Add a bottom panel containing a 14px semibold title ("Studio Light"), a 12px description and a small "View" button. The panel is translated 100% down at rest. On hover and on :focus-within slide it to translateY(0) over 300ms cubic-bezier(.2,.7,.2,1) and scale the image to 1.04 over 500ms ease-out. The panel uses a white background and a 1px top border. Under @media (hover:none) keep the panel visible and no zoom. Keep the button reachable by keyboard; Tab focus must reveal the panel. Under prefers-reduced-motion replace the slide with a 120ms fade and remove the zoom.About this pattern
Definition
A card that shows only its image at rest. When hovered or focused, a panel with title, description and a button slides up over the lower part of the image.
Purpose & UX principles
- Keeps galleries clean while still offering detail on demand.
- The reveal also triggers on keyboard focus and is always visible on touch devices, so the information is never hidden from people who cannot hover.
- The caption panel has a solid background so text stays readable on any image.
Interaction states
- Rest (image only), hover and focus-within (panel visible, image zooms 4%), pressed, focus-visible on the inner button.
Motion specification
- Panel slide: translateY(100%) to 0, 300ms cubic-bezier(.2,.7,.2,1).
- Image zoom: scale 1 to 1.04, 500ms ease-out.
- Reduced motion: panel appears with a 120ms fade and the image does not zoom.
Responsive behaviour
- The card keeps a 4:3 ratio and fills its cell.
- Without hover support the panel is permanently shown in a compact form.
Code
<article class="rc">
<div class="img"></div>
<div class="panel">
<h3>Studio Light</h3>
<p>Soft shadows and quiet colour.</p>
<button class="go" type="button">View</button>
</div>
</article>:root{--bg:#F1F1EF;--surface:#fff;--surface-2:#F7F7F5;--line:#E0E0DC;--text:#171717;--muted:#6f6f6f;--accent:#171717;--accent-ink:#fff;--danger:#d92d20}
*{box-sizing:border-box;margin:0}
.rc{position:relative;width:min(280px,100%);aspect-ratio:4/3;border-radius:14px;overflow:hidden;border:1px solid var(--line);background:var(--surface)}
.img{position:absolute;inset:0;background:linear-gradient(140deg,#dcdcd7,#b9b9b3 60%,#d6d6d1);transition:transform .5s ease-out}
.panel{position:absolute;left:0;right:0;bottom:0;padding:12px 14px 14px;background:var(--surface);border-top:1px solid var(--line);transform:translateY(100%);transition:transform .3s cubic-bezier(.2,.7,.2,1)}
h3{font-size:14px;font-weight:600}
p{font-size:12px;color:var(--muted);margin:2px 0 10px}
.go{height:30px;padding:0 14px;border-radius:99px;border:0;background:var(--accent);color:var(--accent-ink);font:inherit;font-size:12.5px;font-weight:600;cursor:pointer}
.go:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
.rc:hover .panel,.rc:focus-within .panel{transform:none}
.rc:hover .img,.rc:focus-within .img{transform:scale(1.04)}
@media (hover:none){.panel{transform:none}.rc:hover .img{transform:none}}
@media (prefers-reduced-motion:reduce){.img{transition:none}.rc:hover .img,.rc:focus-within .img{transform:none}.panel{transform:none;opacity:0;transition:opacity .12s}.rc:hover .panel,.rc:focus-within .panel{opacity:1}}document.querySelector('.go').addEventListener('click',e=>{e.target.textContent='Opened';setTimeout(()=>e.target.textContent='View',1200);});One complete HTML file. Save it and open it in a browser.
<!doctype html>
<html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>Hover Reveal Card — demo</title>
<style>
:root{--bg:#F1F1EF;--surface:#fff;--surface-2:#F7F7F5;--line:#E0E0DC;--text:#171717;--muted:#6f6f6f;--accent:#171717;--accent-ink:#fff;--danger:#d92d20}
*{box-sizing:border-box;margin:0}
html,body{height:100%}body{background:var(--bg);color:var(--text);font:15px/1.5 -apple-system,BlinkMacSystemFont,'Segoe UI',Inter,Roboto,sans-serif;-webkit-font-smoothing:antialiased}.stage{min-height:100%;display:grid;place-items:center;padding:24px}button,input,select,textarea{font-family:inherit}@media (prefers-reduced-motion:reduce){html{scroll-behavior:auto}}
.rc{position:relative;width:min(280px,100%);aspect-ratio:4/3;border-radius:14px;overflow:hidden;border:1px solid var(--line);background:var(--surface)}
.img{position:absolute;inset:0;background:linear-gradient(140deg,#dcdcd7,#b9b9b3 60%,#d6d6d1);transition:transform .5s ease-out}
.panel{position:absolute;left:0;right:0;bottom:0;padding:12px 14px 14px;background:var(--surface);border-top:1px solid var(--line);transform:translateY(100%);transition:transform .3s cubic-bezier(.2,.7,.2,1)}
h3{font-size:14px;font-weight:600}
p{font-size:12px;color:var(--muted);margin:2px 0 10px}
.go{height:30px;padding:0 14px;border-radius:99px;border:0;background:var(--accent);color:var(--accent-ink);font:inherit;font-size:12.5px;font-weight:600;cursor:pointer}
.go:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
.rc:hover .panel,.rc:focus-within .panel{transform:none}
.rc:hover .img,.rc:focus-within .img{transform:scale(1.04)}
@media (hover:none){.panel{transform:none}.rc:hover .img{transform:none}}
@media (prefers-reduced-motion:reduce){.img{transition:none}.rc:hover .img,.rc:focus-within .img{transform:none}.panel{transform:none;opacity:0;transition:opacity .12s}.rc:hover .panel,.rc:focus-within .panel{opacity:1}}
</style></head>
<body><div class="stage">
<article class="rc">
<div class="img"></div>
<div class="panel">
<h3>Studio Light</h3>
<p>Soft shadows and quiet colour.</p>
<button class="go" type="button">View</button>
</div>
</article>
</div>
<script>
document.querySelector('.go').addEventListener('click',e=>{e.target.textContent='Opened';setTimeout(()=>e.target.textContent='View',1200);});
</script>
</body></html>