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
Installation
npx shadcn@latest add https://fancyborders.vercel.app/r/page-rails.jsonThe 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.
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
import { PageRails } from "@/components/page-rails";| Prop | Type | Default |
|---|---|---|
| bleed | boolean | number | stringHow far the rails run past the top and bottom of the column. true runs them a full viewport height each way. | false |
| gutter | number | stringWidth 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. | – |
| dash | number | stringDash length. Setting dash or gap makes the rails dashed. | 4 |
| gap | number | stringSpace between dashes. | 4 |
Also accepts every Frame prop and every div attribute.