Skip to content

Grid Layout Config ​

Configuration for Mermaid's built-in grid layout.

Properties ​

PropertyTypeDefaultDescription
placementsRecord<string, GridPlacement | [GridPlacement, ...GridPlacement[]]>{}Placement map keyed by the authored placement ID when present; otherwise, by the emitted node ID. Non-empty arrays target repeated IDs in source order; a single object is equivalent to a one-item array.
columnsinteger0Non-negative candidate column count for auto-placement. 0 means automatic.
rowGapnumber50Pixel gap between occupied rows.
columnGapnumber50Pixel gap between occupied columns.
cellGapnumber20Pixel gap between items that explicitly share one cell.
containerPaddingnumber20Minimum padding inside groups.
titleGapnumber8Clearance between a measured group title and the child grid.
horizontalAlignleft | center | rightcenterDefault horizontal item alignment.
verticalAligntop | center | bottomcenterDefault vertical stack alignment.
curvebasis | bumpX | bumpY | cardinal | catmullRom | linear | monotoneX | monotoneY | natural | step | stepAfter | stepBefore | roundedroundedCurve style used to render grid edges.
edgeCornerRadiusnumber5Pixel radius used for grid edges when curve is rounded.
lineHops'arc' | 'gap' | false'arc'Draws edge crossings as arcs (default), visible gaps, or plain crossings when false. Preserves corner radii and arrowhead offsets; smoothing curves such as basis are left unchanged.

GridPlacement ​

PropertyTypeDescription
rowintegerSafe integer row number local to the direct parent group, including zero and negative values.
columnintegerSafe integer column number local to the direct parent group, including zero and negative values.
horizontalAlignleft | center | rightItem alignment within the resolved cell.
verticalAligntop | center | bottomStack alignment within the resolved cell.
Opens in mermaid.ai