Skip to content

Target

Use the target attribute to define the target board to render when using composition.

src/content/docs/example.md
```d2 target="storefront"
# Root board
Content -> Website: Astro
layers: {
# Board named "starlight" that does not inherit anything from root
starlight: {
Documentation -> Website: Starlight
}
# Board named "storefront" that does not inherit anything from root
storefront: {
E-commerce -> Website: Storefront
}
}
```

The above code block will be rendered as the following diagram with only the storefront board being visible:

Diagram