Skip to content
shadcn.io

shadcn.io is not affiliated with official shadcn/ui

Cards Grid Blog Block for React

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.

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 grid of post cards for React with Base UI, written for the Kelvane Journal, the engineering blog of a hosted Postgres. A compact header with an outline All posts link sits over six cards that share their hairlines and run from rail to rail, three across on a desktop and two on a tablet, ending the block so the next section's top rule closes the grid. Each card is one link, its title, and the whole card is the target: a drawn greyscale cover, the category as an outline badge, the title, a one-line dek and a byline with the author's initials, the date and the reading time. The covers come from a kit of three kinds, all drawn in your theme's tokens: a small UI drawing of the post's subject (a latency chart, a branch graph), a typographic cover with the post's first words or a numeral, and a line pattern that belongs to the post's category. On a phone the cards become rows with the cover as a thumbnail at the end. It's built from Guides, Badge, Avatar and Button, with CSS for the entrance and the hover. For product blogs, engineering journals, newsrooms and any page that lists its latest writing.

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 ("2026-09-15"), a reading time in minutes, an href and a cover. Dates are fixed, never computed from today, and are formatted in UTC so the server and the browser print the same day. Initials are taken from the author's first and last names. Six posts fill two rows of three and three rows of two; any count works, because each cell draws its own hairlines.

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

cover picks one of three kinds. A UI drawing (latency, branches) is a small SVG of the post's subject; a type cover sets the post's display words in large type, or a numeral such as "14B" even larger; a pattern cover draws the line pattern its category owns in PATTERNS, so every Design post looks alike. Every colour is a theme token, so the covers follow light and dark and any preset, and the type is sized in container units, so a cover reads the same on a card and as a phone's thumbnail. To use photos, put an img with object-cover and size-full inside the cover's frame: the frame keeps its aspect, ring and radius.

How does it fit on a phone?

Below sm each card becomes a row: the category and the title at the start with the cover as a small thumbnail at the end, then the dek and the byline across the full width, so all six posts fit in about two and a half screens. From sm the posts are cards with the cover on top, two across, and three across from lg. Bylines are pinned to the foot of each card, so a row's bylines line up. Nothing scrolls sideways at 320 pixels.

Does it work right to left?

Yes. The grid and every card mirror, and the arrow on All posts turns. The date and the reading time are isolated with bdi, so "12 min read" keeps its order. The covers are artwork and never mirror, as a photo wouldn't.

  • Pro

    Six text-only posts as raised cards in one tinted frame, two across: category, title as the card's one link, a short dek and a line with author, 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

    Eight posts in staggered CSS columns, each cell leading with a drawn pattern cover in a poster, square or wide shape; six show on a phone behind a More posts button.

  • Pro

    A coffee journal's archive with a ruled band of category chips and their counts over eight post cells: choosing a chip removes the other posts, a polite line says how many show, and the wall keeps its height.

  • Pro

    Three post cells on shared hairlines, each with a drawn wood-grain cover and three tag chips; a post with more tags shows a +3 button that opens a popover of the rest as links with counts.

  • Pro

    Grid Cards Team

    Grids and walls

    Twelve people of a restaurant-software company in a hairline grid that runs from rail to rail, each an initials avatar with a name, a role, a department badge and a city, under a department picker that brings the picked team to the front and dims everyone else.