Blog grid
A grid of recent posts built from the blog card, with a view-all link.
Preview
Cards rise in one after another as the grid scrolls into view. With reduced motion turned on, it renders the plain layout.
Installation
Run this in a project that already uses shadcn/ui. It adds the component and anything it needs; the motion version also adds the plain one and the motion package.
Usage
import { BlogGrid } from "@/components/custom/blog-grid";
<BlogGrid
title="From the blog"
posts={posts}
viewAll={{ label: "All posts", href: "/blog" }}
/>import { BlogGridMotion } from "@/components/custom/blog-grid/blog-grid-motion";
<BlogGridMotion posts={posts} />Props
| Prop | Type | Default | Description |
|---|---|---|---|
| posts* (required) | BlogCard props[] | – | title, excerpt, author, date, href, image?, readTime?, category? |
| viewAll | { label; href } | – | Link to the full blog. |
| title / description | string | – | Heading (h2) and line under it. |
| ...props | React.ComponentProps<"section"> | – | Any other section attribute (id, aria-*, data-*, ref) goes to the root element. |
| Prop | Type | Default | Description |
|---|---|---|---|
| posts* (required) | BlogCard props[] | – | title, excerpt, author, date, href, image?, readTime?, category? |
| viewAll | { label; href } | – | Link to the full blog. |
| title / description | string | – | Heading (h2) and line under it. |
| ...props | React.ComponentProps<"section"> | – | Any other section attribute (id, aria-*, data-*, ref) goes to the root element. |
Accessibility
- Each post is an article from BlogCard.
- The motion version follows the visitor's reduced-motion setting and never hides content before it animates.
