s-m-r-t

ArticleCard

Card component for article previews. Shows title, excerpt, date, author, and optional tags. Links to the article detail page.

Installation

typescript
import { ArticleCard } from '@happyvertical/smrt-svelte';

Basic Usage

Article card with all default options.

With Tags

Show article tags as badges.

Minimal Card

Title only without metadata.

svelte
<ArticleCard
  article={article}
  showExcerpt={false}
  showDate={false}
  showAuthor={false}
/>

Props

PropTypeDefaultDescription
article *Article-Article object with id, slug, title, description, publish_date, author, tags
showExcerpt booleantrueShow article description/excerpt
showDate booleantrueShow publication date
showAuthor booleantrueShow author name
showTags booleanfalseShow article tags as badges

TypeScript

typescript
import { ArticleCard } from '@happyvertical/smrt-svelte';

interface Article {
  id: string;
  slug: string;
  title: string;
  description: string | null;
  publish_date: string | null;
  author: string | null;
  tags: string; // JSON array or comma-separated
}

interface Props {
  article: Article;
  showExcerpt?: boolean;
  showDate?: boolean;
  showAuthor?: boolean;
  showTags?: boolean;
}