Skip to content

Blog / Article Reader

A typography-first editorial layout with scroll-aware components, in-article search highlighting, and a simulated article fetch — implemented across React, Vue, and Lit.

Try it Live

Open any framework example directly in StackBlitz:

Open React in StackBlitzOpen Vue in StackBlitzOpen Lit in StackBlitz
Mobile layout

Mobile

Mobile dark mode layout

Mobile - Dark

Tablet layout

Tablet

Tablet dark mode layout

Tablet - Dark

Desktop layout

Desktop

Desktop dark mode layout

Desktop - Dark

Skins & Customization

Each live example includes a skin switcher (bottom-right corner) to preview other themes instantly. Colors, spacing, and typography are fully customizable via design tokens.

What's Included

Experimental Feature: AI-Assisted UI Generation

Generating UI components via LLM prompting is non-deterministic; different models (and even different versions of the same model) can produce drastically varying results from identical prompts.

While these prompts have been tested using the Claude Code CLI (running Claude Sonnet 4.5 and Opus 4.5), the output remains experimental. Always verify generated code for visual consistency, accessibility, and production readiness before deployment.

  • Three framework examples: React, Vue, and Lit implementations
  • ScrollProgress — fixed top bar showing read progress as the user scrolls
  • ScrollToButton — floating button (bottom-right) that appears after scrolling past ~30% of the article
  • Mark — "Find in article" feature that highlights matching search terms inline
  • AspectRatio — wraps the hero image to enforce a consistent 16:9 ratio across all breakpoints
  • Loader — shown on initial load before article content appears (simulated async fetch)
  • PROMPT-3-FRAMEWORKS.md: Feed directly to your LLM for AI‑assisted customization

Using with an LLM

The PROMPT-3-FRAMEWORKS.md file contains everything an AI assistant needs to understand and modify the article reader:

  1. Copy the PROMPT-3-FRAMEWORKS.md contents
  2. Paste into Claude, ChatGPT, or your preferred LLM
  3. Ask for customizations: "Add a table of contents sidebar that highlights the active section as the user scrolls"

Components Used

ComponentPurpose
ag-scroll-progressFixed top progress bar showing read depth
ag-scroll-to-buttonFloating back-to-top button, visible after 30% scroll
ag-markInline text highlighting for the "Find in article" search
ag-aspect-ratioHero image wrapper enforcing a consistent 16:9 ratio
ag-loaderFull-page loading state before article content renders
ag-headerTop navigation bar with logo and theme toggle
ag-avatarAuthor portrait in the article meta and author card
ag-badgeReading time estimate displayed in the article header
ag-input"Find in article" search field
ag-dividerSection separators between article body, author card, and more
ag-tabsArticle / Comments tab panel below the article body
ag-tagArticle category label in the header meta

Responsive Behavior

BreakpointLayout
Mobile (<768px)Full-width single column, hero image full-bleed
Tablet (768–1199px)Centered column ~680px, hero image full-width
Desktop (≥1200px)Centered reading column ~720px max with generous side margins