Dev Helpers

Next.js / Section layouts

Reading width layout

Dev Helpers · May 15, 2026

A shared reading layout keeps text measure consistent across sibling articles. A wide illustration may need a controlled exception to the prose width.

Worked example

// app/studio/layout.tsx

import type { ReactNode } from "react";

export default function ReadingWidthLayout({ children }: { children: ReactNode }) {
  return (
    <main
      style={{ width: "min(100% - 2rem,68ch)", marginInline: "auto", lineHeight: 1.7 }}
    >
      {children}
    </main>
  );
}

Implementation notes

A reading-width control can affect tables and code differently from paragraphs. Let wide material scroll locally rather than forcing the page to expand.

Try it yourself

Open a short article and one containing a long code line.

Open the Next.js example →

Editorial date May 15, 2026 · Published December 6, 2026

Related articles

Free bin volume

Free storage volume depends on consistent dimensions and units. Derive capacity and usage in the same unit before formatting a human-readable summary.

Draft preview indexing

Draft pages need deliberate indexing metadata. An indexing directive controls crawler intent, while access to unpublished material needs a separate permission check.

Party size allocation

Allocating a party into groups is an integer problem. The remainder determines whether another group is needed and how full it will be.