Sequence diagrams: grouping with divider/box

Sequence diagrams: grouping with divider/box

puml.online

Introduction

When a sequence diagram has many messages it gets messy. Dividers / Groups / Boxes let you visually containerize related messages. PlantUML uses group and so does Mermaid — the syntax is nearly identical but the details differ.

PlantUML

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
@startuml
skinparam backgroundColor #FEFEFE
skinparam groupBackgroundColor #E8F4FD
skinparam groupBorderColor #1E90FF

participant Client
participant "Auth Service" AS Auth
participant "API Gateway" AS GW

group Authentication
Client -> Auth : Login request
Auth -> Auth : Verify credentials
Auth --> Client : JWT Token
end

group Business request
Client -> GW : Request + JWT
GW -> GW : Validate Token
GW --> Client : Business data
end
@enduml

Mermaid

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
sequenceDiagram
participant C as Client
participant A as Auth Service
participant G as API Gateway

group Authentication
C->>A: Login request
A->>A: Verify credentials
A-->>C: JWT Token
end

group Business request
C->>G: Request + JWT
G->>G: Validate Token
G-->>C: Business data
end

Side by side

Feature PlantUML Mermaid
Keyword group <label> group <label>
End marker end end
Nesting Yes, multi-level Yes
Styling skinparam groupBackgroundColor CSS / theme override
Label Single line, right after group Same as PlantUML
Arrow style -> / --> ->> / -->>

Wrap-up

PlantUML and Mermaid share nearly identical group syntax, so the learning curve is minimal. PlantUML lets you deeply customize colors and borders via skinparam; Mermaid currently relies more on CSS themes. For quick small diagrams Mermaid wins; when you need fine-grained styling go with PlantUML.

  • Title: Sequence diagrams: grouping with divider/box
  • Author: puml.online
  • Created at : 2026-08-30 09:00:00
  • Updated at : 2026-12-06 10:29:22
  • Link: https://puml.online/en/blog/sequence-diagram-divider/
  • License: This work is licensed under CC BY-NC-SA 4.0.
On this page
Sequence diagrams: grouping with divider/box