Skip to main content

Style D2

D2 supports themes, shape properties, style blocks, classes, and sketch mode.

Start with the general presentation settings. They control the canvas background, padding, and frame for every diagram.

Source controlsโ€‹

  • Put local values in an element style block.
  • Define reusable classes when elements use the same style.
  • Use shape properties to control geometry and labels.

Renderer optionsโ€‹

OptionValuesPurpose
themeD2 theme name or numberApply a D2 theme.
layoutdagre or elkSelect the layout engine.
sketchFlagApply the hand-drawn style.