Marketing sectionsPostGrid

Open in Create
Search
astronomic.dev

PostGrid

Free

To show the latest posts as cards, each with a picture, a date and a short excerpt.

File
PostGrid.astro
Group
Marketing sections
Kind
Static: no JavaScript
Examples
4
import PostGrid from "@astronomic-dev/ui/components/PostGrid.astro";

Examples

Drag the orange handle to set the width. Frames get real breakpoints.

  • Static
  • Interactive
  • Framed

Latest posts

Three posts as cards, each with a picture, the meta line (the topic, the date and the reading time), the title, an excerpt and a footer with the author, then the link to all posts. As many columns as fit, each at least 18rem: one on a phone, two from about 37rem, three in a wide row. Each card fills its row, so the footers line up on the bottom edge. The whole card opens the post; the topic is a link of its own.

main.astro

No posts yet

No posts and an empty text: the heading, then the text in place of the list. With no empty text, no list and no text show: leave the section out.

empty.astro

In a narrow column

Three posts in a 24rem column, one per row: one with a picture, one with no picture (the card starts with the meta line: its plain-text topic and the date), and one with no excerpt (the title, then the footer). A long title wraps inside the card.

narrow.astro

Your own images

Astro's <Image> draws each post's picture (imageComponent={Image}), with no wrapper; the kit draws the frame and passes a sizes hint for this layout; the authors' Avatars stay plain. Astro writes a srcset when your astro.config sets image.layout. For EmDash or another CMS, see "Your own images" in the kit README.

own-images.astro
Minimal · Light

Waitlist

Be first in line

Join the waitlist and we'll email you the moment it's out.

You'll also get our newsletter: new themes, plugins and guides. Unsubscribe any time.