sigil/UI

Alignment Rails

Snap sections, navbars, and grids to a deterministic alignment rail system.

What are alignment rails

Alignment rails are invisible vertical guides that every layout component snaps to. They create consistent horizontal rhythm across navbars, hero sections, content areas, and footers — without manually matching padding values.

Sigil defines two rail pairs:

RailTokenDefaultPurpose
Outer rail--s-rail-gap24pxDistance from viewport edge to content boundary
Content rail--s-content-max1280pxMaximum content width, centered

Every layout component — Section, Navbar, Grid, PageGrid, Footer — reads these tokens. Change --s-content-max once and every section realigns.

How it works

┌──────────────────────────────────────────────────┐
│  viewport                                        │
│  ┌─ outer rail ─────────────────── outer rail ─┐ │
│  │  24px         content max 1280px       24px │ │
│  │  ┌───────────────────────────────────────┐  │ │
│  │  │  Navbar                               │  │ │
│  │  ├───────────────────────────────────────┤  │ │
│  │  │  Hero section                         │  │ │
│  │  ├───────────────────────────────────────┤  │ │
│  │  │  Content grid                         │  │ │
│  │  └───────────────────────────────────────┘  │ │
│  └─────────────────────────────────────────────┘ │
└──────────────────────────────────────────────────┘

Using the alignment system

Section

Section centers content within the content rail and applies outer rail padding automatically.

import { Section } from "@sigil-ui/components";

<Section>
  <h2>This content snaps to the alignment rails</h2>
  <p>Max width is controlled by --s-content-max.</p>
</Section>

Full-bleed sections

Some sections need to break out of the content rail while keeping inner content aligned:

<Section fullBleed>
  <div className="bg-[var(--s-surface)]">
    {/* Background extends to viewport edges */}
    {/* Inner content still respects content-max */}
    <p>Full bleed background, aligned content.</p>
  </div>
</Section>

The Navbar component reads the same rail tokens, so its content automatically aligns with page sections below it:

import { Navbar } from "@sigil-ui/components";

<Navbar>
  <Navbar.Brand>Sigil</Navbar.Brand>
  <Navbar.Links>
    <a href="/docs">Docs</a>
    <a href="/presets">Presets</a>
  </Navbar.Links>
</Navbar>
<Section>
  <p>This text aligns with the navbar brand above.</p>
</Section>

Grid snapping

The Grid component subdivides the content rail into cells using --s-grid-cell:

import { Grid } from "@sigil-ui/components";

<Section>
  <Grid columns={3} gap={24}>
    <div>Column 1</div>
    <div>Column 2</div>
    <div>Column 3</div>
  </Grid>
</Section>

Customizing rails

Override the rail tokens in your preset or global CSS:

:root {
  --s-rail-gap: 32px;
  --s-content-max: 1440px;
  --s-grid-cell: 64px;
}

Responsive rails

Use media queries to tighten rails on smaller screens:

@media (max-width: 768px) {
  :root {
    --s-rail-gap: 16px;
    --s-content-max: 100%;
  }
}

Rail tokens reference

TokenDefaultDescription
--s-rail-gap24pxOuter margin between viewport and content
--s-content-max1280pxMaximum content width
--s-grid-cell48pxBase grid cell dimension
--s-cross-arm10pxCross mark arm length (structural grid)
--s-cross-stroke1.5pxCross mark stroke width
Studiodefault
Presets
primary
secondary
background
surface
text
border
accent
success
warning
error
info
display
body
mono
heading wt
600
heading trk
-0.025em
base size
16px
page margin
24px
section pad
64px
card pad
24px
grid gap
24px
stack gap
12px
global
8px
button
8px
card
12px
input
6px
border w
1px
style
card border
card shadow
btn shadow
glow
spring
Type
Duration
0.20
Bounce
1.00
easing
cubic-bezier(0.16, 1, 0.3, 1)
fast
150ms
normal
200ms
slow
300ms
hover scale
1.02
press scale
0.98
hover lift
-1px
stagger
50ms
weight
transform
hover
active scale
0.98
min-width
0px
letter sp
0.000em
icon gap
8px
shadow
hover
border
shadow
padding
24px
title size
1px
title wt
desc size
0.875px
aspect
outline
height
36px
focus ring
2px
focus ring
h1 size
2.25px
h2 size
1.875px
h3 size
1.5px
h4 size
1.25px
weight
tracking
-0.020em
leading
1.20
pattern
pattern α
0.03
noise
gradient
grad angle
180°
height
50px
blur
12px
border
padding
24px
item gap
24px
min-height
600px
padding Y
80px
content-max
680px
layout
title size
56px
desc size
18px
padding Y
64px
max-width
600px
layout
title size
36px
padding Y
48px
columns
4
gap
36px
content-max
1200px
rail-gap
24px
grid-cell
50px
cross-stroke
1.5px
navbar-h
50px
bento-gap
16px
grid lines
dots
cell borders
cell bg
Gutter
Margin
content
hero
navbar
rail visible
enabled