Blog Card Grid

Grid of blog post cards

Marketing BlockBlog

Overview

Renders an array of BlogPost items in a responsive grid. Supports a standard card style (with author avatar and category badge) and a minimal style activated by readMoreLabel. An optional section heading with a link can be placed above the grid.

Usage

import { BlogCardGrid } from "@leanicon/web-builder-library";

Default (3 columns)

Standard card style with image, category badge, excerpt, and author avatar.

  • React code
    TutorialGetting Started with React in 2024

    A comprehensive guide to starting your React journey, covering the latest patterns.

    JD
    Jane Doe
  • TypeScript code
    TypeScriptAdvanced TypeScript Patterns

    Explore conditional types, mapped types, and template literal types for better code.

    JS
    John Smith
  • CSS code
    CSSMastering CSS Grid Layout

    From basic concepts to advanced techniques for complex, responsive layouts.

    AJ
    Alice Johnson

2 columns

Without images

Cards without the image prop skip the image area entirely.

Use heading and headerLink to add a section title with a "view all" link above the grid.

The latest news

See more on the blog

Read more style

Setting readMoreLabel switches cards to a minimal layout: muted background, no border, author + date inline, no excerpt, and a "Read more" footer link with arrow.

With heading + read more style

Combines heading, headerLink, and readMoreLabel for a complete blog section.

The latest news

See more on the blog

Sharp corners

Set corners="sharp" to remove border-radius from cards and images.

The latest news

See more on the blog

Dark mode

Dark mode (read more style)

The latest news

See more on the blog

Props

Prop

Type

Default

Description

posts

BlogPost[]

—

Array of blog post objects (required)

columns

1 | 2 | 3

3

Number of grid columns

heading

string

—

Section heading above the grid

headerLink

{ label: string; href: string }

—

"View all" link next to the heading

readMoreLabel

string

—

Switches cards to minimal style with a read more footer

corners

"rounded" | "sharp"

"rounded"

Card and image border-radius

colorScheme

"light" | "dark"

—

Force light or dark mode

className

string

—

Additional CSS classes on root

BlogPost

Prop

Type

Description

title

string

Post title (linked to href)

excerpt

string

Short description (hidden in read more style)

image

ImageProps?

Cover image with hover zoom effect

date

string

Published date string

author

{ name: string; avatar?: ImageProps }

Author info — avatar falls back to initials

category

string?

Category badge (hidden in read more style)

href

string

Link URL for the post

Notes

  • When readMoreLabel is provided, the card style changes: no border, muted background, no excerpt, no category badge, no avatar — replaced by inline author + date and a "Read more" footer link.
  • author.avatar is optional; the fallback shows the author's initials.
  • Images have a hover:scale-105 zoom transition on hover.
  • Dark mode: pass colorScheme="dark" or place inside a .dark ancestor.

Props

NameTypeDefaultRequiredDescription
postsBlogPost[]—Yes
featuredPostBlogPost—No
columnsenum3No
colorSchemeenum—No
classNamestring—No
headingstring—No
headerLink{ label: string; href: string; }—No
readMoreLabelstring—No
cornersenumroundedNo