Grid

Lines, squares, dots or plain paper, with independent ink and paper colours. The default pitch is one 20px square. The Grid draws the background; your layout places the content.

Rows against the paper grid

The visible grid makes the shared row pitch and icon columns easy to inspect.

Patterns and paper

Change the ruling, spacing, ink and paper. The content stays in place.

AttributeDefaultWhat it does
patterngridgrid, lines, columns, dots or none.
size20Column spacing in unscaled pixels; 10 gives half squares.
row-sizeSame as sizeIndependent row pitch, such as 30 for taller rows.
colorQuiet neutral inkAny CSS colour, including a token such as var(--ds-sharp-blue).
paperTransparentAny CSS colour or colour mix for the paper.
containedfalseFill a positioned container instead of overlaying the viewport.
aligncenterleft, center or right for the fixed overlay.

Use a positioned wrapper for contained paper. Keep content in a positioned sibling above the Grid, as in the example. The component ignores pointer events and has no interactive or readable content. Changing the ruling does not move or resize the surrounding content.

Colours can use light-dark() or inherited theme tokens. Removing color or paper restores the theme default. pattern="none" keeps the paper colour while removing its marks.

--ds-sf scales spacing and overlay dimensions; --sf is the fallback for older surfaces. A 20px pitch remains aligned with a fourteen-square phone layout when it shares that layout’s scale. Rules stay one physical CSS pixel by default.

Override --ds-grid-color, --ds-grid-paper, --ds-grid-stroke, --ds-grid-origin-x and --ds-grid-origin-y at the host. --ds-grid-unit and --ds-grid-row accept already-scaled pitches. The fixed overlay accepts --ds-grid-width, --ds-grid-height and --ds-grid-z-index. A contained Grid fills its wrapper and scrolls with it.

On the documentation, press G three times to toggle the separate page inspection grid. Press L three times to inspect the layout: named areas in dashed outlines with their name and size (give them data-ds-area="name"), text and fields in green boxes, and every component outlined with its tag name, such as ds-select. Escape hides the inspection overlays. Typing in a field does not trigger them.

Layout · Styling