Grids
Apply customizable, autowrapping grids to any shape or overlay on existing blocks
Grids help you visually organize diagram elements by applying a consistent background pattern.
Quick Start
Every grid is defined by two steps: horizontal and vertical. Even if they match, you must provide both:
grid={...}
always requires <step-x>
and <step-y>
to be defined, even if they have the same value
You can also use a different step-size
per-axis:
Customizing Line Thickness
Adjust the thickness of the grid lines globally or per axis:
Shape‑Aware Grids
Grids adapt to any primitive shape—rectangle, circle, diamond, you name it. Just add type
:
For the full list of shapes, see the Basic Styles guide.
Standalone and Overlaid Grids
Standalone Grids
Treat a grid as its own element for independent styling:
Overlaying a Grid
Often you want to create a grid to overlay on another block. In these situations you can use the store-style
key on the target \nskBlock[...]
- Capture the original block style with
store-style
:
- Overlay your grid onto
ablock
: usegrid-on=
to point to the target block'sid
:
Sometimes you find yourself wanting only the grid lines, without the outer border. You can easily disable it:
Reference Table
Prop | Type | Default |
---|---|---|
grid | dimension list | — |
grid-line-size? | dimension | [dimension, dimension] | 0.4pt |
store-style? | boolean | false |
grid-on? | token list | — |
grid-outer-border? | boolean | true |