Skip to content
Viewership Inquire
UI Components

Post Card.

Blog card with an inset image, byline, title and arrow, excerpt, tag and date. The whole card is a single link.

ContentComponentNo dependencies Original, MIT

.md

Using Claude Code? Give it the agent prompt and skip these steps.

  1. Import the foundation once

    foundation.css holds the tokens every component reads.

    Layout.astro
    ---
    // src/layouts/Layout.astro
    import "../styles/foundation.css";
    ---
  2. Copy PostCard.astro

    Paste into src/components/viewership/post-card/

  3. Use it

    Page.astro
    ---
    import PostCard from "../components/viewership/post-card/PostCard.astro";
    ---
    
    <PostCard />

Props 10

PropTypeDefaultDescription
href string · Post URL. The title link is stretched over the whole card.
title string · Post title.
excerpt string · One or two sentences under the title.
author string · Byline name.
readTime string · Shown after the author, e.g. "5 min read".
tag string · Category pill in the footer.
date string | Date · ISO date or Date, rendered in a <time> element.
image { src; alt; width?; height? } · Cover image, cropped to 3:2.
as "h2" | "h3" | "h4" "h3" Heading element for the title.
slot: media slot · Replaces the image (video, illustration).

Source 1 file

Original, MIT.

Used by Blog Grid