Blog card
Title, excerpt, author, date, read time, category and cover image in three layouts. Uses next/image.
Preview
Lifts on hover with a spring. With reduced motion turned on, it renders the plain layout.
GuideBuilding a landing page in an afternoon
Pick the sections you need, install them with one command and spend the rest of the day on copy.
Sarah Wilson
5 min read
GuideBuilding a landing page in an afternoon
Pick the sections you need, install them with one command and spend the rest of the day on copy.
Sarah Wilson
5 min read
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 { BlogCard } from "@/components/custom/blog-card";
<BlogCard
title="Building a landing page in an afternoon"
excerpt="Pick the sections you need and install them."
author="Sarah Wilson"
date="2026-01-15"
readTime="5 min read"
category="Guide"
image={post.coverUrl}
href="/blog/landing-page"
/>import { BlogCardMotion } from "@/components/custom/blog-card/blog-card-motion";
<BlogCardMotion {...props} />Props
| Prop | Type | Default | Description |
|---|---|---|---|
| title* (required) | string | – | Post title. |
| excerpt* (required) | string | – | Short summary. |
| author* (required) | string | – | Author name. |
| date* (required) | string | – | Publish date. |
| readTime | string | – | Such as “5 min read”. |
| image | string | – | Cover image, rendered with next/image. |
| authorAvatar | string | – | Author image URL. |
| href | string | – | Where the card links to. |
| category | string | – | Category badge text. |
| categoryColor | string | "bg-gray-100 text-gray-800" | Tailwind classes for the badge. |
| likes | number | – | Like count. |
| variant | "default" | "horizontal" | "minimal" | "default" | Layout. |
| onClick | () => void | – | Click handler. Needs a client component parent. |
| ...props | React.ComponentProps<"article"> | – | Any other article attribute (id, aria-*, data-*, ref) goes to the root element. |
| Prop | Type | Default | Description |
|---|---|---|---|
| title* (required) | string | – | Post title. |
| excerpt* (required) | string | – | Short summary. |
| author* (required) | string | – | Author name. |
| date* (required) | string | – | Publish date. |
| readTime | string | – | Such as “5 min read”. |
| image | string | – | Cover image, rendered with next/image. |
| authorAvatar | string | – | Author image URL. |
| href | string | – | Where the card links to. |
| category | string | – | Category badge text. |
| categoryColor | string | "bg-gray-100 text-gray-800" | Tailwind classes for the badge. |
| likes | number | – | Like count. |
| variant | "default" | "horizontal" | "minimal" | "default" | Layout. |
| onClick | () => void | – | Click handler. Needs a client component parent. |
| ...props | React.ComponentProps<"article"> | – | Any other article attribute (id, aria-*, data-*, ref) goes to the root element. |
Accessibility
- Renders as an <article> with the date in a <time> element.
- Like counts read as “N likes”.
- The motion version follows the visitor's reduced-motion setting and never hides content before it animates.