s-m-r-t

ArticleList

Grid layout for displaying multiple article cards. Automatically handles responsive columns and empty states.

Installation

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

Basic Usage

Display articles in a responsive grid layout.

Fixed Columns

Specify exact number of columns.

With Tags

Show article tags as badges.

Minimal Display

Show only titles and excerpts.

Empty State

Custom message when no articles available.

No blog posts yet. Check back soon!

svelte
<ArticleList
  articles={[]}
  emptyMessage="No blog posts yet. Check back soon!"
/>

Props

PropTypeDefaultDescription
articles *Article[]-Array of article objects to display
columns number | 'auto''auto'Number of grid columns or auto for responsive
showExcerpt booleantrueShow article descriptions
showDate booleantrueShow publication dates
showAuthor booleantrueShow author names
showTags booleanfalseShow article tags as badges
emptyMessage string'No articles published yet...'Message shown when no articles

TypeScript

typescript
import { ArticleList } 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 {
  articles: Article[];
  columns?: number | 'auto';
  showExcerpt?: boolean;
  showDate?: boolean;
  showAuthor?: boolean;
  showTags?: boolean;
  emptyMessage?: string;
}