Components / Structure

Page Rails

The column a page is laid out in: a vertical rail down each side, optionally with a patterned gutter.

Page content

Sections go here, flush with the rails.

Customize

Gutter
16px
Gutter fill
Bleed
24px
Dashed

Installation

npx shadcn@latest add https://fancyborders.vercel.app/r/page-rails.json

The CLI copies the component into your project, adds anything it is built on, and writes its CSS into your global stylesheet. New to the CLI? See Installation.

Examples

A whole page

Rails, section rules and a section grid together. The rules cross the rails, and the grid's lines stop at them.

Acme

A page laid out on its own lines.

Rails

Two lines the page hangs from.

Rules

Lines that cross the rails.

Grids

Cells that share their lines.

Marks

One on every crossing.

Free and open source

Good to know

  • Everything inside sits flush with the rails, so pad your sections rather than the column. That is what lets a rule, a divider or a grid meet the rails exactly.
  • With bleed set to true the rails run a full viewport height past each end. The page then needs overflow-y: clip on an ancestor.

API reference

PageRails

tsx
import { PageRails } from "@/components/page-rails";
PropTypeDefault
bleedboolean | number | string

How far the rails run past the top and bottom of the column. true runs them a full viewport height each way.

false
gutternumber | string

Width of a gutter down each side. A second pair of rails is drawn this far inside the first, and the content sits between the inner pair.

–
fill"hatch" | "cross" | "dots" | "grid"

Pattern drawn in the gutters.

–
dashnumber | string

Dash length. Setting dash or gap makes the rails dashed.

4
gapnumber | string

Space between dashes.

4

Also accepts every Frame prop and every div attribute.