Dev Helpers
← Back

Centered reading column

Import and render <CenteredReadingColumn /> in a React project.

Open this example in the interactive library

Live preview

Source code

// components/CenteredReadingColumn.tsx

import type { ReactNode } from "react";

export default function CenteredReadingColumn({
  children = "Your content",
}: { children?: ReactNode } = {}) {
  return (
    <article
      style={{
        maxWidth: "65ch",
        marginInline: "auto",
        padding: "clamp(1rem,4vw,3rem)",
        lineHeight: 1.7,
      }}
    >
      {children}
    </article>
  );
}