Skip to content

Themes

D2 includes a variety of built-in themes. Use the theme option to set one.

Light themes

IDName
0Neutral Default
1Neutral Grey
3Flagship Terrastruct
4Cool Classics
5Mixed Berry Blue
6Grape Soda
7Aubergine
8Colorblind Clear
100Vanilla Nitro Cola
101Orange Creamsicle
102Shirley Temple
103Earth Tones
104Everglade Green
105Buttered Toast

Dark themes

IDName
200Dark Mauve
201Dark Flagship Terrastruct
202Terminal
300Terminal
301Terminal Grayscale
302Origami

Auto-switching

By default, diagrams use theme 0 in light mode and theme 200 in dark mode. This switches automatically when the user toggles Slidev's dark mode.

To customize, use ```d2 {theme: 5, darkTheme: 302}:

d2
a -> b
  • theme — used in light mode (and both modes if darkTheme is not set)
  • darkTheme — used only in dark mode

Preview

Browse all themes with visual examples at the D2 Theme Gallery.

Released under the MIT License.