Skip to content
shadcn.io

shadcn.io is not affiliated with official shadcn/ui

Rectangular Cards Blog Block for Vue

Four horizontal post cards in rows from rail to rail, the drawn cover at one end and the text at the other, mirroring row by row, each row numbered.

Framework
UI library

Preview

Preview width

Installation

Part of Pro
Pro unlocks the code and one-line install of every Pro button and text effect, plus the MCP for your AI editor.
Have Pro already? Sign in to open it.Opens here as soon as you're Pro.

Overview

A zig-zag list of posts for Vue with Ark UI, written for Oblong Press, a print shop's blog. Four horizontal cards run from rail to rail on shared hairlines, ending the block. Each has a drawn greyscale cover at one end and its text at the other (the number "01" to "04", a rule and the category, then the title, a one-line dek and a byline), and the cover swaps ends row by row. The covers are small drawings of the print job each post is about: a poster layout, a book spread, a business card, a registration-mark sheet, all in your theme's tokens and never photos. Every card is one link, its title. On a phone the rows keep their cover as a thumbnail at the start and don't mirror. It's built from Guides, Badge, Avatar and Button. For print shops, studios and blogs that read like a contents page.

FAQ

How do I add my own posts?

Edit POSTS at the top of the file. Each post has a title, a one-line dek, an author, a category, a date as an ISO string, a reading time in minutes, an href and a cover. The row's number comes from its place in the list, and the zig-zag follows the same order, so adding a post keeps the alternation. Dates are fixed and formatted in UTC.

How does the zig-zag work without extra markup?

Each row's li is a named group, and the card's classes use group-even/row from md: even rows swap the two grid tracks and move the cover to the second column. The DOM is the same for every row (cover, then text), so the reading order never changes and no row is duplicated.

How are the covers drawn, and how do I use photos?

cover picks one of four SVG drawings (poster, spread, card, marks), each built from rectangles, lines and a few paths in a 320 by 240 box, with every stroke a hairline at any size. To use photos, replace the drawings with an img with object-cover and size-full inside PostCover: the frame keeps its 4:3 shape, ring and radius.

How does it fit on a phone?

Each row becomes a thumbnail at the start (6.5rem wide) beside the number, the category and the title, with the dek and the byline under them. Nothing mirrors on a phone. The four rows take about two screens, and nothing scrolls sideways at 320 pixels.

Does it work right to left?

Yes. Odd rows put the cover at the start (the right side) and even rows at the end, the arrows turn, and the date and the reading time are isolated with bdi. The covers are artwork and never mirror, as a photo wouldn't.