Interactive Card
A clickable card that lifts slightly on hover and slides its arrow forward.
AI prompt
Build a media card, 300px wide, with a 16:9 image placeholder area, a 15px semibold title, a 13px secondary description of two lines and a small "Read more" label with an arrow. The whole card is one link: make the title an anchor and stretch it over the card with an ::after pseudo-element positioned absolutely at inset 0. On hover and keyboard focus, translateY(-3px), darken the 1px border and move the arrow 4px to the right, all in 180ms with cubic-bezier(.2,.7,.2,1). While pressed remove the lift. Show a visible 2px focus ring around the whole card using :focus-within. On devices without hover keep the arrow visible and skip the lift. Under prefers-reduced-motion remove the transform animations and only change the border colour. Prevent navigation in the demo and print "Opened: Field notes" into an aria-live status line under the card.About this pattern
Definition
A surface that groups an image, a title and a short description, and acts as one large link. Hover and focus raise it a few pixels and move a small arrow, so the whole area reads as clickable.
Purpose & UX principles
- One card, one destination: the entire surface is the hit area, not only the title.
- The title is the real link; a pseudo-element stretches it over the card so keyboard and screen-reader users hear one clear link.
- Subtle motion confirms interactivity without competing with the content.
Interaction states
- Default, hover (lift 3px, border darkens, arrow moves 4px), focus-visible (2px ring around the card), pressed (lift removed).
- Visited or opened state can be shown with a small label; here a status line confirms the click.
Motion specification
- Lift and border: 180ms cubic-bezier(.2,.7,.2,1).
- Arrow: translateX 4px over 180ms.
- Reduced motion: no lift or arrow movement; only the border colour changes.
Responsive behaviour
- Cards fill their grid cell; the image keeps a fixed aspect ratio (16:9).
- On touch devices there is no hover, so the arrow is always visible and the pressed state replaces the lift.
Code
<div class="wrap">
<article class="card">
<div class="img"></div>
<div class="body">
<h3><a href="#" id="lnk">Field notes</a></h3>
<p>Short observations about interface details, collected from everyday apps.</p>
<span class="more">Read more <i>→</i></span>
</div>
</article>
<p class="status" id="st" aria-live="polite">Hover, focus or click the card.</p>
</div>: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}
.wrap{display:grid;gap:12px;justify-items:center}
.card{position:relative;width:min(300px,100%);background:var(--surface);border:1px solid var(--line);border-radius:14px;overflow:hidden;transition:transform .18s cubic-bezier(.2,.7,.2,1),border-color .18s}
.img{aspect-ratio:16/9;background:linear-gradient(135deg,#e6e6e2,#cfcfca)}
.body{padding:14px 16px 16px}
h3{font-size:15px;font-weight:600;margin-bottom:4px}
h3 a{color:inherit;text-decoration:none}
h3 a::after{content:"";position:absolute;inset:0}
p{font-size:13px;color:var(--muted);line-height:1.5}
.more{display:inline-block;margin-top:10px;font-size:12.5px;font-weight:600}
.more i{display:inline-block;font-style:normal;transition:transform .18s cubic-bezier(.2,.7,.2,1)}
@media (hover:hover){.card:hover,.card:focus-within{transform:translateY(-3px);border-color:#a8a8a3}.card:hover .more i,.card:focus-within .more i{transform:translateX(4px)}}
.card:active{transform:none}
.card:focus-within{outline:2px solid var(--accent);outline-offset:2px}
.status{font-size:12px;color:var(--muted)}
@media (prefers-reduced-motion:reduce){.card,.more i{transition:none}.card:hover,.card:focus-within{transform:none}.card:hover .more i,.card:focus-within .more i{transform:none}}const lnk=document.getElementById('lnk'),st=document.getElementById('st');
lnk.addEventListener('click',e=>{e.preventDefault();st.textContent='Opened: Field notes';});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>Interactive 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}}
.wrap{display:grid;gap:12px;justify-items:center}
.card{position:relative;width:min(300px,100%);background:var(--surface);border:1px solid var(--line);border-radius:14px;overflow:hidden;transition:transform .18s cubic-bezier(.2,.7,.2,1),border-color .18s}
.img{aspect-ratio:16/9;background:linear-gradient(135deg,#e6e6e2,#cfcfca)}
.body{padding:14px 16px 16px}
h3{font-size:15px;font-weight:600;margin-bottom:4px}
h3 a{color:inherit;text-decoration:none}
h3 a::after{content:"";position:absolute;inset:0}
p{font-size:13px;color:var(--muted);line-height:1.5}
.more{display:inline-block;margin-top:10px;font-size:12.5px;font-weight:600}
.more i{display:inline-block;font-style:normal;transition:transform .18s cubic-bezier(.2,.7,.2,1)}
@media (hover:hover){.card:hover,.card:focus-within{transform:translateY(-3px);border-color:#a8a8a3}.card:hover .more i,.card:focus-within .more i{transform:translateX(4px)}}
.card:active{transform:none}
.card:focus-within{outline:2px solid var(--accent);outline-offset:2px}
.status{font-size:12px;color:var(--muted)}
@media (prefers-reduced-motion:reduce){.card,.more i{transition:none}.card:hover,.card:focus-within{transform:none}.card:hover .more i,.card:focus-within .more i{transform:none}}
</style></head>
<body><div class="stage">
<div class="wrap">
<article class="card">
<div class="img"></div>
<div class="body">
<h3><a href="#" id="lnk">Field notes</a></h3>
<p>Short observations about interface details, collected from everyday apps.</p>
<span class="more">Read more <i>→</i></span>
</div>
</article>
<p class="status" id="st" aria-live="polite">Hover, focus or click the card.</p>
</div>
</div>
<script>
const lnk=document.getElementById('lnk'),st=document.getElementById('st');
lnk.addEventListener('click',e=>{e.preventDefault();st.textContent='Opened: Field notes';});
</script>
</body></html>