Page tabs

The PageTabs component under test: rhythm against the page's spacing, deep links between tabs, closed-tab crawler check and a row of nine tabs for overflow.

Using it

Each tab is an id, a label and its content. The ids end up in the URL hash.

tsx
import { PageTabs } from "@/components/site/page-tabs";

<PageTabs
  tabs={[
    { id: "overview", label: "Overview", children: <Overview /> },
    { id: "details", label: "Details", children: <Details /> },
  ]}
/>

Try it

The first tab, open by default. Switch tabs and watch the address bar: the hash follows.

Reload the page on another tab and it opens there.

The same blocks outside the tabs

For comparison with the Rhythm tab: the gaps should match.

A heading

A paragraph straight after the heading, then a list.

  • First item
  • Second item
ts
const sample = "a code block";
WhereSpacing between blocks
On the pagethe page's own flow rhythm
In a tabshould be the same

A last paragraph.

Many tabs

Narrow the window: the bar should scroll sideways instead of wrapping or overflowing the page.

This is the one tab. With this many, the bar has to scroll sideways on a phone.

Things to check

  • Crawlers. The Zebra-4 sentence should be in the page source even while its tab is closed.
  • Rhythm. The blocks in the tab and the same blocks below should have the same gaps.
  • Deep links. Load the page with #rhythm on the end and it should open on that tab. Back and forward shouldn't break it.
  • Two sets. Switching the lower set must not change the upper one.
  • Hidden headings. A heading inside a closed tab can't be scrolled to, so a contents link to it does nothing. Worth remembering before putting headings in tabs.
  • Outline smoothing

    The byline chips' blue outline drawn seven ways, to see which anti-aliases most smoothly.

  • Byline designs

    Ways to show a page's author, dates, AI authorship and tags without crowding its header.

  • Artifact controls

    Candidate bars and frames for artifacts that need controls, shown in the places artifacts appear.

  • Structural type

    Test page for comparing Google Fonts and Inter variable settings across the site header, tagline, navigation and footer.