Article Card Meta Layouts
One article card in vertical, horizontal and compact forms with a clear order of meta.
AI prompt
Clean UI mockup showing the same article card in three layouts: a vertical card with a wide cover image, a small uppercase category label, a bold headline, a one-line summary and a muted line with author name, date and 6 min read; a horizontal card with the image on the left; and a compact text-only card in a narrow sidebar, light theme, rounded corners, thin borders, flat modern style. Negative: heavy shadows, clutter, text errors. Reduced motion: static design.About this pattern
Definition
A content card must show what the piece is, why to read it and how long it takes, in a clear order. Category is a small label, the title is the largest element, and the author, date and read time sit in a muted meta line. Changing layout should not change that order of importance.
Purpose & UX principles
- Order: image, category, title, one-line summary, meta.
- Title is the only large text; meta uses small muted text with separators.
- Vertical cards suit grids; horizontal cards suit lists; compact cards suit sidebars and drop the image.
- Make the whole card one link, with the title as the link text.
Interaction states
- Three layout buttons; hover or focus the card.
Motion specification
- The card lifts 2px on hover over 150ms.
- Reduced motion: no lift.
Responsive behaviour
- Give images empty alt text if they only decorate, and a real alt if they carry meaning.
- Do not truncate titles to one line if it hides the meaning.
Code
<div class="bx"><div class="pre" id="pre" role="group" aria-label="Layout"><button data-p="0" aria-pressed="true">Vertical</button><button data-p="1" aria-pressed="false">Horizontal</button><button data-p="2" aria-pressed="false">Compact</button></div><a class="ac" id="ac" href="#" onclick="return false"><i class="im"></i><span class="bd"><small class="ct">Design</small><b>Why small details make interfaces feel finished</b><span class="sm">A look at spacing, timing and the quiet choices users never notice.</span><small class="mt">Maya Chen · Nov 12 · 6 min read</small></span></a></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}
button{font:inherit;color:inherit;background:none;border:0;padding:0;cursor:pointer}a{color:inherit;text-decoration:none}ul,ol,p,h4{margin:0;padding:0}.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
.pre{display:flex;gap:5px;flex-wrap:wrap}.pre button{height:28px;padding:0 11px;border-radius:99px;border:1px solid var(--line);background:var(--surface);font-size:11px;cursor:pointer}
.pre button[aria-pressed=true]{background:var(--accent);color:var(--accent-ink);border-color:var(--accent)}
.bx{width:min(330px,100%);display:grid;gap:9px}.rw{display:grid;gap:3px;font-size:11.5px;color:var(--muted)}.rw b{color:var(--text);font-weight:600}input[type=range]{width:100%;accent-color:#171717}
.out{font-size:12px;color:var(--muted);line-height:1.4}.out b{color:var(--text)}
button:focus-visible,input:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
.ac{display:flex;flex-direction:column;border:1px solid var(--line);border-radius:14px;background:#fff;overflow:hidden;transition:transform .15s,box-shadow .15s;color:inherit;text-decoration:none;max-width:250px;margin:0 auto}.ac:hover,.ac:focus-visible{transform:translateY(-2px);box-shadow:0 8px 18px rgba(0,0,0,.1)}.im{display:block;height:84px;background:linear-gradient(135deg,#f6c28b,#e57f6b 55%,#7b6bd6)}.bd{display:grid;gap:3px;padding:10px 12px 12px}.ct{font-size:10px;font-weight:800;letter-spacing:.07em;text-transform:uppercase;color:#d1432f}.bd b{font-size:14px;line-height:1.25}.sm{font-size:11.5px;color:#555;line-height:1.4}.mt{font-size:10.5px;color:#8a8a86;margin-top:2px}.ac.h{flex-direction:row;max-width:none}.ac.h .im{width:34%;height:auto;min-height:104px;flex:none}.ac.c{max-width:none}.ac.c .im{display:none}.ac.c .sm{display:none}.ac.c{border-left:3px solid #d1432f}@media (prefers-reduced-motion:reduce){.ac{transition:none}.ac:hover,.ac:focus-visible{transform:none}}
@media (prefers-reduced-motion:reduce){*{transition:none!important;animation:none!important}}const ac=document.getElementById('ac'),bs=[...document.querySelectorAll('#pre button')];let p=0;
function up(){ac.className='ac '+['','h','c'][p];bs.forEach(b=>b.setAttribute('aria-pressed',String(+b.dataset.p===p)));}
bs.forEach(b=>b.addEventListener('click',()=>{p=+b.dataset.p;up();}));up();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>Article Card Meta Layouts — 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}}
button{font:inherit;color:inherit;background:none;border:0;padding:0;cursor:pointer}a{color:inherit;text-decoration:none}ul,ol,p,h4{margin:0;padding:0}.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
.pre{display:flex;gap:5px;flex-wrap:wrap}.pre button{height:28px;padding:0 11px;border-radius:99px;border:1px solid var(--line);background:var(--surface);font-size:11px;cursor:pointer}
.pre button[aria-pressed=true]{background:var(--accent);color:var(--accent-ink);border-color:var(--accent)}
.bx{width:min(330px,100%);display:grid;gap:9px}.rw{display:grid;gap:3px;font-size:11.5px;color:var(--muted)}.rw b{color:var(--text);font-weight:600}input[type=range]{width:100%;accent-color:#171717}
.out{font-size:12px;color:var(--muted);line-height:1.4}.out b{color:var(--text)}
button:focus-visible,input:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
.ac{display:flex;flex-direction:column;border:1px solid var(--line);border-radius:14px;background:#fff;overflow:hidden;transition:transform .15s,box-shadow .15s;color:inherit;text-decoration:none;max-width:250px;margin:0 auto}.ac:hover,.ac:focus-visible{transform:translateY(-2px);box-shadow:0 8px 18px rgba(0,0,0,.1)}.im{display:block;height:84px;background:linear-gradient(135deg,#f6c28b,#e57f6b 55%,#7b6bd6)}.bd{display:grid;gap:3px;padding:10px 12px 12px}.ct{font-size:10px;font-weight:800;letter-spacing:.07em;text-transform:uppercase;color:#d1432f}.bd b{font-size:14px;line-height:1.25}.sm{font-size:11.5px;color:#555;line-height:1.4}.mt{font-size:10.5px;color:#8a8a86;margin-top:2px}.ac.h{flex-direction:row;max-width:none}.ac.h .im{width:34%;height:auto;min-height:104px;flex:none}.ac.c{max-width:none}.ac.c .im{display:none}.ac.c .sm{display:none}.ac.c{border-left:3px solid #d1432f}@media (prefers-reduced-motion:reduce){.ac{transition:none}.ac:hover,.ac:focus-visible{transform:none}}
@media (prefers-reduced-motion:reduce){*{transition:none!important;animation:none!important}}
</style></head>
<body><div class="stage">
<div class="bx"><div class="pre" id="pre" role="group" aria-label="Layout"><button data-p="0" aria-pressed="true">Vertical</button><button data-p="1" aria-pressed="false">Horizontal</button><button data-p="2" aria-pressed="false">Compact</button></div><a class="ac" id="ac" href="#" onclick="return false"><i class="im"></i><span class="bd"><small class="ct">Design</small><b>Why small details make interfaces feel finished</b><span class="sm">A look at spacing, timing and the quiet choices users never notice.</span><small class="mt">Maya Chen · Nov 12 · 6 min read</small></span></a></div>
</div>
<script>
const ac=document.getElementById('ac'),bs=[...document.querySelectorAll('#pre button')];let p=0;
function up(){ac.className='ac '+['','h','c'][p];bs.forEach(b=>b.setAttribute('aria-pressed',String(+b.dataset.p===p)));}
bs.forEach(b=>b.addEventListener('click',()=>{p=+b.dataset.p;up();}));up();
</script>
</body></html>