Skip to content
shadcn.io

shadcn.io is not affiliated with official shadcn/ui

Rectangular Cards Blog Block for React

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 React with Base 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.

  • Pro

    Cards Grid Blog

    Card grids

    The six latest posts of an engineering blog as cards on shared hairlines: drawn greyscale covers, a category, the title as the card's one link, a one-line dek and a byline with the date and reading time.

  • Pro

    Featured Post Blog

    Featured story

    One lead post as a split, its copy beside a drawn greyscale cover behind a divider, with three more posts as cells on shared hairlines under it.

  • Pro

    Hero Featured Blog

    Featured story

    A blog landing: the lead story as a framed drawn cover with its copy on a raised panel overlapping the cover's corner, and a numbered rail of the four latest posts beside it.

  • Pro

    Latest Posts Blog

    Featured story

    Just published: the newest post as a lead band in large type with a pulsing dot and a New mark, three earlier posts as rows with unread dots, and a Mark all as read button.

  • Pro

    Cover Story Blog

    Featured story

    A printed magazine cover drawn in greyscale beside the cover story's copy, a Shine Button and an ordered list of the issue's pieces with leader dots and page numbers.

  • Pro

    Large Preview Blog

    Featured story

    One long read at poster size: a wide drawn cover in a frame and a raised panel with the title, the dek and a byline whose author link opens a hover card.