Blocks · Marketing
Post grid
The latest blog posts as story cards, picture on top, under a section header with a link to every post; page links on an index. No card ends a row alone.
34% of 139 news overviews and 16% of 671 home pages we studied have a posts or changelog section.
Blog
From the workshop
Notes on the components: what we built, and why it works the way it does.

Guide
Tabs that keep their place
Arrow keys, Home and End, and a panel that follows.
4 Nov 2026 · 4 min read

Engineering
Dialogs on the native element
Focus stays inside, and goes back where it came from when the dialog closes.
3 Nov 2026 · 3 min read

Data
Charts you can read without colour
Values on the bars, and a table for screen readers.
2 Nov 2026 · 5 min read
Blog
From the workshop
Notes on the components: what we built, and why it works the way it does.

Guide
Tabs that keep their place
Arrow keys, Home and End, and a panel that follows.
4 Nov 2026 · 4 min read

Engineering
Dialogs on the native element
Focus stays inside, and goes back where it came from when the dialog closes.
3 Nov 2026 · 3 min read

Data
Charts you can read without colour
Values on the bars, and a table for screen readers.
2 Nov 2026 · 5 min read
Both previews render the same markup; the HTML tab below is that markup without a framework.
Install
- React
- npx shadcn@
latest add https:// www.themes.dev/ ui/ r/ post-grid.json - Astro
- npx shadcn@
latest add https:// www.themes.dev/ ui/ r/ astro/ post-grid.json
Or copy the files below into your project. They need clsx, tailwind-merge and the components they import, and the themes.dev UI theme. The HTML needs only the compiled CSS.
/** Post grid: a section header (with an optional link to every post), then the latest posts as story cards with the
* picture on top, and optional page links under them. Columns follow the block's own width and leave no card alone on
* a row: three or six posts go three across from 56rem (six go two across from 36rem first), two or four go two across
* from 36rem, other counts stack. */
export const postGrid = {
root: '@container bg-background px-6 py-16 text-foreground @3xl:py-24',
inner: 'mx-auto flex max-w-6xl flex-col gap-12',
list: (count: number) =>
[
'm-0 grid list-none gap-6 p-0',
// Six (or twelve) split evenly into twos and threes; three or nine only into threes, so they stack until then.
count % 6 === 0 ? '@xl:grid-cols-2 @4xl:grid-cols-3' : count % 3 === 0 ? '@4xl:grid-cols-3' : count % 2 === 0 ? '@xl:grid-cols-2' : '',
].join(' '),
item: 'flex',
// The picture row keeps its ratio; a taller neighbour's extra height goes to the text, so the kickers line up.
card: 'w-full grid-rows-[auto_1fr]',
// The first control's padding steps outside the content edge, so its chevron lines up with the cards' edge.
pagination: '-ms-2.5 self-start',
};
/** One post, as the story card takes it: kicker is the topic in words, meta the date and reading time. */
export type Post = { title: string; href: string; kicker?: string; description?: string; meta?: string; image?: { src: string; alt: string } };
export type PostGridContent = {
kicker?: string;
title: string;
description?: string;
/** Beside the heading: the blog index (All posts, /blog). */
link?: { href: string; label: string };
/** One to nine, newest first. */
posts: Post[];
/** Page links under the posts, on a blog index. href(n) is page n's address. */
pagination?: { page: number; pages: number; href: (page: number) => string };
/** Unique on the page; ids the heading. */
id: string;
};import { Link } from '@/components/ui/link';
import { Pagination } from '@/components/ui/pagination';
import { SectionHeader } from '@/components/ui/section-header';
import { StoryCard } from '@/components/ui/story-card';
import { cn } from '@/lib/utils';
import { postGrid as c, type PostGridContent } from './post-grid.classes';
export type PostGridProps = PostGridContent & { className?: string };
/** A section header and the latest posts as story cards, picture on top; optional page links under them. */
export function PostGrid({ kicker, title, description, link, posts, pagination, id, className }: PostGridProps) {
return (
<section aria-labelledby={`${id}-title`} className={cn(c.root, className)}>
<div className={c.inner}>
<SectionHeader id={`${id}-title`} kicker={kicker} title={title} description={description}>
{link && <Link href={link.href} variant="standalone">{link.label}</Link>}
</SectionHeader>
<ul role="list" className={c.list(posts.length)}>
{posts.map((p) => (
<li key={p.href + p.title} className={c.item}>
<StoryCard {...p} className={c.card} />
</li>
))}
</ul>
{pagination && <Pagination current={pagination.page} total={pagination.pages} href={pagination.href} label="Blog pages" className={c.pagination} />}
</div>
</section>
);
}---
import Link from '@/components/ui/link.astro';
import Pagination from '@/components/ui/pagination.astro';
import SectionHeader from '@/components/ui/section-header.astro';
import StoryCard from '@/components/ui/story-card.astro';
import { cn } from '@/lib/utils';
import { postGrid as c, type PostGridContent } from './post-grid.classes';
type Props = PostGridContent & { class?: string };
const { kicker, title, description, link, posts, pagination, id, class: className } = Astro.props;
---
<section aria-labelledby={`${id}-title`} class={cn(c.root, className)}>
<div class={c.inner}>
<SectionHeader id={`${id}-title`} kicker={kicker} title={title} description={description}>
{link && <Link href={link.href} variant="standalone">{link.label}</Link>}
</SectionHeader>
<ul role="list" class={c.list(posts.length)}>
{
posts.map((p) => (
<li class={c.item}>
<StoryCard {...p} class={c.card} />
</li>
))
}
</ul>
{pagination && <Pagination current={pagination.page} total={pagination.pages} href={pagination.href} label="Blog pages" class={c.pagination} />}
</div>
</section>/** Post grid: a section header (with an optional link to every post), then the latest posts as story cards with the
* picture on top, and optional page links under them. Columns follow the block's own width and leave no card alone on
* a row: three or six posts go three across from 56rem (six go two across from 36rem first), two or four go two across
* from 36rem, other counts stack. */
export const postGrid = {
root: '@container bg-background px-6 py-16 text-foreground @3xl:py-24',
inner: 'mx-auto flex max-w-6xl flex-col gap-12',
list: (count: number) =>
[
'm-0 grid list-none gap-6 p-0',
// Six (or twelve) split evenly into twos and threes; three or nine only into threes, so they stack until then.
count % 6 === 0 ? '@xl:grid-cols-2 @4xl:grid-cols-3' : count % 3 === 0 ? '@4xl:grid-cols-3' : count % 2 === 0 ? '@xl:grid-cols-2' : '',
].join(' '),
item: 'flex',
// The picture row keeps its ratio; a taller neighbour's extra height goes to the text, so the kickers line up.
card: 'w-full grid-rows-[auto_1fr]',
// The first control's padding steps outside the content edge, so its chevron lines up with the cards' edge.
pagination: '-ms-2.5 self-start',
};
/** One post, as the story card takes it: kicker is the topic in words, meta the date and reading time. */
export type Post = { title: string; href: string; kicker?: string; description?: string; meta?: string; image?: { src: string; alt: string } };
export type PostGridContent = {
kicker?: string;
title: string;
description?: string;
/** Beside the heading: the blog index (All posts, /blog). */
link?: { href: string; label: string };
/** One to nine, newest first. */
posts: Post[];
/** Page links under the posts, on a blog index. href(n) is page n's address. */
pagination?: { page: number; pages: number; href: (page: number) => string };
/** Unique on the page; ids the heading. */
id: string;
};<section aria-labelledby="ex-posts-title" class="@container bg-background px-6 py-16 text-foreground @3xl:py-24">
<div class="mx-auto flex max-w-6xl flex-col gap-12">
<header class="@container w-full">
<div class="flex flex-wrap items-end justify-between gap-x-8 gap-y-4">
<div class="min-w-0 grow basis-[24rem]">
<p class="text-sm font-medium text-muted-foreground">Blog</p>
<h2 id="ex-posts-title" class="mt-2 text-3xl font-semibold tracking-[-0.03em] text-balance @xl:text-4xl">From the workshop</h2>
<p class="mt-3 max-w-xl text-base text-pretty text-muted-foreground">Notes on the components: what we built, and why it works the way it does.</p>
</div>
<div class="shrink-0">
<a href="#blog" class="rounded-sm font-medium text-foreground underline-offset-4 transition-[color,text-decoration-color,background-color] active:bg-accent [&_svg]:size-3.5 [&_svg]:shrink-0 [&_svg]:transition-transform group inline-flex min-h-6 items-center gap-1.5 hover:underline active:decoration-2 hover:[&_svg]:translate-x-0.5">
All posts
<svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M3 8h10M9 4l4 4-4 4"></path></svg>
</a>
</div>
</div>
</header>
<ul role="list" class="m-0 grid list-none gap-6 p-0 @4xl:grid-cols-3">
<li class="flex">
<article class="group relative isolate grid overflow-hidden rounded-xl border bg-card text-card-foreground transition-[border-color,box-shadow] hover:border-foreground/30 hover:shadow-md has-[a:active]:bg-pressed/40 @container w-full grid-rows-[auto_1fr]">
<div class="relative overflow-hidden bg-muted aspect-[16/9]">
<img src="/ui/demo/stories/tabs.jpg" alt="The tabs page of the docs in light mode" loading="lazy" decoding="async" class="size-full object-cover transition-transform duration-500 group-hover:scale-[1.03] motion-reduce:transition-none">
</div>
<div class="flex flex-col gap-2 p-5">
<p class="text-xs font-medium text-muted-foreground">Guide</p>
<h3 class="text-lg leading-snug font-semibold tracking-[-0.02em] text-balance">
<a href="#tabs-that-keep-their-place" class="rounded-sm underline decoration-transparent underline-offset-4 transition-[text-decoration-color] after:absolute after:inset-0 after:z-10 after:rounded-xl group-hover:decoration-foreground/40 hover:decoration-foreground active:bg-accent active:decoration-2">
Tabs that keep their place
</a>
</h3>
<p class="text-sm text-pretty text-muted-foreground">Arrow keys, Home and End, and a panel that follows.</p>
<p class="mt-auto pt-2 text-xs text-muted-foreground tabular-nums">4 Nov 2026 · 4 min read</p>
</div>
</article>
</li>
<li class="flex">
<article class="group relative isolate grid overflow-hidden rounded-xl border bg-card text-card-foreground transition-[border-color,box-shadow] hover:border-foreground/30 hover:shadow-md has-[a:active]:bg-pressed/40 @container w-full grid-rows-[auto_1fr]">
<div class="relative overflow-hidden bg-muted aspect-[16/9]">
<img src="/ui/demo/stories/dialog.jpg" alt="A rename dialog open over the docs in dark mode" loading="lazy" decoding="async" class="size-full object-cover transition-transform duration-500 group-hover:scale-[1.03] motion-reduce:transition-none">
</div>
<div class="flex flex-col gap-2 p-5">
<p class="text-xs font-medium text-muted-foreground">Engineering</p>
<h3 class="text-lg leading-snug font-semibold tracking-[-0.02em] text-balance">
<a href="#dialogs-on-the-native-element" class="rounded-sm underline decoration-transparent underline-offset-4 transition-[text-decoration-color] after:absolute after:inset-0 after:z-10 after:rounded-xl group-hover:decoration-foreground/40 hover:decoration-foreground active:bg-accent active:decoration-2">
Dialogs on the native element
</a>
</h3>
<p class="text-sm text-pretty text-muted-foreground">Focus stays inside, and goes back where it came from when the dialog closes.</p>
<p class="mt-auto pt-2 text-xs text-muted-foreground tabular-nums">3 Nov 2026 · 3 min read</p>
</div>
</article>
</li>
<li class="flex">
<article class="group relative isolate grid overflow-hidden rounded-xl border bg-card text-card-foreground transition-[border-color,box-shadow] hover:border-foreground/30 hover:shadow-md has-[a:active]:bg-pressed/40 @container w-full grid-rows-[auto_1fr]">
<div class="relative overflow-hidden bg-muted aspect-[16/9]">
<img src="/ui/demo/stories/bar-chart.jpg" alt="A bar chart of deploys per month" loading="lazy" decoding="async" class="size-full object-cover transition-transform duration-500 group-hover:scale-[1.03] motion-reduce:transition-none">
</div>
<div class="flex flex-col gap-2 p-5">
<p class="text-xs font-medium text-muted-foreground">Data</p>
<h3 class="text-lg leading-snug font-semibold tracking-[-0.02em] text-balance">
<a href="#charts-without-colour" class="rounded-sm underline decoration-transparent underline-offset-4 transition-[text-decoration-color] after:absolute after:inset-0 after:z-10 after:rounded-xl group-hover:decoration-foreground/40 hover:decoration-foreground active:bg-accent active:decoration-2">
Charts you can read without colour
</a>
</h3>
<p class="text-sm text-pretty text-muted-foreground">Values on the bars, and a table for screen readers.</p>
<p class="mt-auto pt-2 text-xs text-muted-foreground tabular-nums">2 Nov 2026 · 5 min read</p>
</div>
</article>
</li>
</ul>
</div>
</section>