Skip to content

Views

Views define what part of the model is shown and how it is laid out. Each view is a window into your architecture from a specific perspective.

Type DSL keyword Scope Purpose
System Landscape systemLandscape Entire workspace All systems and people
System Context systemContext One software system System and its interactions
Container container One software system Internal containers
Component component One container Internal components
Dynamic dynamic System or container Ordered interactions
Deployment deployment Environment + system Infrastructure topology
Filtered filtered Another view Tag-based subset
Custom custom None (free-form) Arbitrary elements
Image image N/A Static image view

All views are defined inside the views { } block:

views {
systemLandscape "Landscape" {
include *
autoLayout
}
systemContext mySystem "Context" {
include *
autoLayout
}
container mySystem "Containers" {
include *
autoLayout
}
}

Every view has a unique key (the string after the scope element). Keys are stable identifiers used for:

  • Linking to views in documentation
  • Stable export filenames
  • Governance and review workflows
systemContext mySystem "MyViewKey" {
...
}

Control which elements appear in a view:

include *
include user
include mySystem
include user -> mySystem
exclude internalService
exclude user -> legacySystem
include element.tag==External

Enable automatic layout positioning:

autoLayout

With direction:

autoLayout lr // left to right
autoLayout tb // top to bottom (default)
autoLayout bt // bottom to top
autoLayout rl // right to left

Elements can be dragged to reposition them on the canvas.

Views support titles, descriptions, and properties:

systemContext mySystem "Context" {
include *
autoLayout
title "System Context Diagram"
description "Shows the system and its external interactions"
properties {
"structurizr.sort" "type"
}
}

Mark a view as the default (opens first when the workspace is loaded):

systemContext mySystem "Context" {
include *
autoLayout
default
}