Skip to main content

Style D2

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

Start with the general presentation settings. Edit shared or raw presentation in Details, and keep renderer-specific styling in Source.

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.