Article Rail
ComponentsArticle Rail
SectionsNew

Article Rail

Give your journal a place on the homepage. Image-led article cards with useful metadata and a touch-friendly reading rail.

USE IT FORBlog previewsResourcesCompany news
React + CSS
01

Installation

Run this in your shadcn-configured React project. The component and stylesheet are added together.

TERMINAL
npx shadcn@latest add http://localhost:5173/r/article-rail.json

This command uses the current site address. For localhost, keep this preview running on the same computer. Files follow your configured components alias.

02

Usage

Import the component and make the details your own.

TypeScript
import { ArticleRail } from '@/components/anticraft/ArticleRail';

export function Example() {
  return (
    <ArticleRail
      title="A little perspective."
      items={[
        {
          id: 'next-chapter', title: 'Designing for the next chapter',
          category: 'Perspective', readTime: '4 min read',
          media: <img src="/images/next-chapter.jpg" alt="" />,
          href: '/journal/next-chapter',
        },
        {
          id: 'clear-story', title: 'A useful website starts with a clear story',
          category: 'Process', readTime: '6 min read',
          media: <img src="/images/clear-story.jpg" alt="" />,
          href: '/journal/clear-story',
        },
        {
          id: 'small-details', title: 'Why small details build trust',
          category: 'Field notes', readTime: '3 min read',
          media: <img src="/images/small-details.jpg" alt="" />,
          href: '/journal/small-details',
        },
      ]}
    />
  );
}
03

Props

PropTypeDefaultDescription
itemsArticleRailItem[]RequiredArticles with unique id, title, category, a real href, and decorative ReactNode media. Optional readTime and date strings appear in the metadata. An empty array renders nothing.
items[].mediaReactNodeRequiredDecorative article artwork, rendered inert and hidden from assistive technology. Keep meaningful information in the title and metadata, and do not include nested controls. Supply your own images for the example paths.
items[].hrefstringRequiredThe article destination. Cards are ordinary anchors, so visitors can open them in a new tab or use your framework’s link adapter if you customize the source.
items[].categorystringRequiredA short editorial category, such as Perspective, Process, or News.
items[].readTime / datestringundefinedOptional preformatted metadata. Supply localized strings such as “4 min read” or “25 October 2026”; the component does not infer reading time or parse dates.
titlestring'Ideas worth sharing'The visible section heading and accessible section label.
classNamestring''Additional classes. Set --ac-article-surface, --ac-article-ink, --ac-article-muted, --ac-article-line, and --ac-article-accent on this element to match your website.
04

Motion & accessibility

Considered by default.

Swipe, use a trackpad, or activate Previous/Next to browse one card at a time. CSS scroll snapping settles the rail on a card. Controls disable at their respective edges and update after scrolling or resizing. Each article stays an ordinary focusable link; Tab brings off-screen links into view. There is no autoplay. Reduced motion makes button-driven paging immediate and removes image, arrow, and underline transitions. The demo opens short local sample articles; replace those destinations with your own journal pages.

Use semantic content and meaningful labels in your composition. Check contrast and keyboard behavior with your own styles and content.

05

Inspiration

The image-led ideas and news cards on Whipsaw’s homepage informed the hierarchy of category, reading time, and article title. Anticraft’s scroll rail, paging controls, and artwork are an original adaptation for homepage journals and resource sections.

Visit Whipsaw — Ideas and news

The component source and demo artwork are original to Anticraft UI. The linked site is the design or content reference.