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.
View types
Section titled “View types”| 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 |
Defining views
Section titled “Defining views”All views are defined inside the views { } block:
views { systemLandscape "Landscape" { include * autoLayout }
systemContext mySystem "Context" { include * autoLayout }
container mySystem "Containers" { include * autoLayout }}View keys
Section titled “View keys”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" { ...}Include and exclude
Section titled “Include and exclude”Control which elements appear in a view:
Include all
Section titled “Include all”include *Include specific elements
Section titled “Include specific elements”include userinclude mySysteminclude user -> mySystemExclude elements
Section titled “Exclude elements”exclude internalServiceexclude user -> legacySystemInclude by expression
Section titled “Include by expression”include element.tag==ExternalAuto layout
Section titled “Auto layout”Enable automatic layout positioning:
autoLayoutWith direction:
autoLayout lr // left to rightautoLayout tb // top to bottom (default)autoLayout bt // bottom to topautoLayout rl // right to leftElements can be dragged to reposition them on the canvas.
View properties
Section titled “View properties”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" }}Default view
Section titled “Default view”Mark a view as the default (opens first when the workspace is loaded):
systemContext mySystem "Context" { include * autoLayout default}See also
Section titled “See also”- DSL Basics — Workspace structure and element types
- Dynamic Views — Ordered interaction views
- Filtered Views — Tag-based view subsets
- Deployment Views — Infrastructure views
- Views Panel (Portal Guide) — UI guide for working with views