17

I cannot make a nested box in plantUML.

@startuml
box "B0" #LightBlue
 Bob -> Alice : hello
 Box "B1" #LightYellow
  Bob --> Cunny : hi
 end box
end box
@enduml

This gives an error that box cannot be nested.

Any other way to show nested box, like in layered diagrams?

Sazzad Hissain Khan
  • 37,929
  • 33
  • 189
  • 256

2 Answers2

20

It seems it's still not supported: http://forum.plantuml.net/6304/please-add-box-and-or-participant-nesting-ability

You can up-vote the feature request.

Mauri
  • 216
  • 3
  • 3
4

It's been implemented and you can use it if you have v1.2022.0 or a newer release. The feature seems to be in an early stage and it needs the teoz engine.

Example:

@startuml
!pragma teoz true
box "component"
  box "sub1\n\n"
    participant a
    box "subsub1"
      participant suba
    end box
  endbox
  box "sub2"
    participant b
  endbox
end box
@enduml

Github issue for reference (The examples comes from here)

Iker
  • 121
  • 1
  • 2
  • 5