Skip to content
shadcn.io

shadcn.io is not affiliated with official shadcn/ui

Rail Timeline Blog Block for React

A local-history society's notebook as a vertical rail: a band per year, the year sticky at the rail's start, and dated entries hung off the rail on dots.

Framework
UI library

Preview

Preview width

Installation

Part of Pro
Pro unlocks the code and one-line install of every Pro button and text effect, plus the MCP for your AI editor.
Have Pro already? Sign in to open it.Opens here as soon as you're Pro.

Overview

A post timeline for React with Base UI, written for Chronicle Lane, a local-history society. A start-aligned header sits over one band per year, each opened by a rule that meets a hairline rail at a + mark. At the rail's start the year stands in large numerals with its post count, and it stays in view while that year's entries pass. At the rail's end each entry hangs on a dot with its date, the title as its one link and a one-line dek. Years and counts are worked out from the typed entries, newest first. There are no controls and no covers, only the rail. On a phone the rail moves to the start and each year stacks over its entries. It's built from Guides and CSS only, so it needs no JavaScript. For history pages, journals and any blog whose age is part of the story.

FAQ

How do I add entries?

Add an object to ENTRIES at the top of the file with a date as an ISO string, a title, a dek and an href. Keep the list newest first. The year bands, their order and the "3 posts" counts are derived from the dates, so the first entry of a new year opens a new band.

How is the rail drawn?

One CSS variable, --rail, holds the rail's distance from the band's start edge. The line, the + mark where it meets each year's rule and the dots all read it, so they cannot drift apart. It is one value on phones and another from lg, where the year takes its own column. Every band draws its own rule with Guides, so the marks land on the rail.

Does the year really stay in view?

From lg the year label is sticky inside its band, so it stays near the top while its entries scroll and hands over to the next year when the next band arrives. On a phone each year simply stacks above its entries; nothing sticks.

How does it work with a keyboard and a screen reader?

It is an ordered list of years, each with an h3 and an ordered list of entries, each an article with an h4 link. There is nothing to operate except the links, so Tab moves from title to title. The dots and the rail are decoration and hidden from assistive technology.

Does it work right to left?

Yes. The rail, the dots and the year column sit on the start side and flip with the page, and the dates and counts are isolated with bdi.

  • Pro

    A farm journal's archive as a nested accordion, years that open to months and months that open to posts, with counts worked out from the posts and an Expand all control.

  • Pro

    Month Calendar Blog

    Archives by date

    A recipe blog's month as a grid of day buttons, one small square per post on each day, and a panel that lists the posts of the chosen day.

  • Pro

    Twenty posts as dense one-line rows like a printed contents page: date, title, a dotted leader and the reading time, eight shown and twelve behind a Show more button.

  • Pro

    Cards Grid Blog

    Card grids

    The six latest posts of an engineering blog as cards on shared hairlines: drawn greyscale covers, a category, the title as the card's one link, a one-line dek and a byline with the date and reading time.

  • Pro

    Latest Posts Blog

    Featured story

    Just published: the newest post as a lead band in large type with a pulsing dot and a New mark, three earlier posts as rows with unread dots, and a Mark all as read button.

  • Pro

    The publication's own changes written as posts: entries with a large version numeral and date at the start, grouped Added, Changed and Fixed lists, and Show earlier notes in a Collapsible.