Search code examples
plantuml

Can I add more sections to state in state diagram?


Each state in the state diagram has 2 sections, the top one is state name and bottom has all the state attributes. For example, for the following:

@startuml
Bob:aaa
Bob:bbb
Bob -> Alice
@enduml

The diagram has "aaa" and "bbb" in the bottom section.

Is it possible I can add more sections to a state? Or some divider lines? Basically I want to separate "aaa" and "bbb" in the above example more clearly.


Solution

  • Using the hints about Class bodies at https://plantuml.com/class-diagram#08ca680401eefe3a, you can try the following separators:

    @startuml
    Bob:aaaaaaaaaaaa
    Bob:....
    Bob:bbb
    Bob:ccccc
    Bob:====
    Bob:dddd
    Bob:----
    Bob:eeeeeeee\n====\nfffff
    Bob -> Alice
    @enduml
    

    enter image description here