Tags and styles | Elements | Relationships | Boundaries and groups

Notation

Unlike formal diagramming notations, Structurizr purposely uses a very simple and constrained notation consisting of boxes and unidirectional arrows, some aspects of which can be customised via a set of element and relationship styles. Any styles that you use are shown on an automatically generated diagram key.

While viewing a diagram, click the button to show the diagram key.

Tags and styles

All elements and relationships within a software architecture model can have one or more tags associated with them. A tag is simply a free-format string. By default, the following tags are associated with elements and relationships.

  • Person: Element and Person
  • Software System: Element and Software System
  • Container: Element and Container
  • Component: Element and Component
  • Deployment Node: Element and Deployment Node
  • Infrastructure Node: Element and Infrastructure Node
  • Software System Instance: Software System Instance
  • Container Instance: Container Instance
  • Relationship: Relationship

These default tags cannot be removed, but additional tags can be associated with any element (except groups/boundaries) or relationship.

Element and relationship styles are associated with a single tag. For example, to render all people as "Person" shapes on the diagrams, you need to create an element style for the Person tag, and specify a shape of Person.

As with CSS, styles cascade according to the order in which they are added. For example, you could create an element style for the Element tag, in which you specify some defaults, and then create another element style for the Software System tag to override one or more of those defaults.

Elements

The following aspects of element notation can be changed, via element styles associated with tags. The Structurizr DSL cookbook - Element styles has some examples of how this works.


Person Software System Container Component Deployment Node Infrastructure Node Boundary Group
Shape
(default="Box")
Icon
(a data URI representing a base64 encoded PNG/JPG file, or a HTTPS URL to a PNG/JPG file; SVG icons are not supported; please see the note about HTTPS and CORS)
Width
(pixels; default=450)
Height
(pixels; default=300)
Background colour
(HTML hex value; default="#dddddd")
Stroke color
(HTML hex value; default=a darker version of the element background)
Stroke width
(pixels, 1-10; default=2)
Text colour
(HTML hex value; default="#000000")
Font size
(pixels; default=24)
Border
("Solid", "Dashed", or "Dotted"; default="Solid")
Opacity
(an integer between 0 and 100; default=100)
Metadata
(true or false, to show or hide the metadata)
Description
(true or false, to show or hide the description)

Relationships

A relationship between two elements is illustrated by unidirectional (one-way) arrow as follows. Bidirectional (two-way) arrows are not recommended because they are ambiguous, and are not supported by Structurizr.


Relationshp without technology
Relationshp with technology

Again, some aspects of this notation can be changed. The Structurizr DSL cookbook - Relationship styles has some examples of how this works.

  • Line thickness (pixels; default=2)
  • Colour (HTML hex value; default="#707070")
  • Style ("Solid", "Dashed", "Dotted"; default="Dashed")
  • Routing ("Direct", "Curved", or "Orthogonal"; default="Direct")
  • Font size (pixels; default=24)
  • Width (of the description block, in pixels; default=200)
  • Position (of the description along the line, as a percentage from start to end; default=50)
  • Opacity (an integer between 0 and 100; default=100)

Boundaries and groups

A number of diagram types may include boundaries to group elements, as follows:

View type Boundaries included Groups included
System landscape Enterprise Software systems, people, custom elements
System context Enterprise Software systems, people, custom elements
Container Software systems Containers
Component Containers (and optionally software systems with structurizr.softwareSystemBoundaries set to true - see Help - Properties) Components
Dynamic
  • Unscoped: same as system landscape
  • Software system scoped: same as container view
  • Container scoped: same as component view
Deployment None None

The following styles are applied to these boundaries by default:

  • Enterprise boundary: dark grey (#444444)
  • Group: dark grey (#444444)
  • Software system boundary: the border colour (stroke colour) of the software system
  • Container boundary: the border colour (stroke colour) of the container

Boundaries can be customised with element styles and the following tags:

  • Boundary: all enterprise/software system/container boundaries
  • Boundary:Enterprise: the enterprise boundary only
  • Boundary:SoftwareSystem: all software system boundaries
  • Boundary:Container: all container boundaries
  • Group: all groups
  • Group:Name: the named group only