How to add a diagram description at the top without a border

0 votes
asked Jun 12, 2025 in Question / help by Omar Medina (160 points)
Hello everyone,

I'm trying to add a short text box at the top of my PlantUML diagram to serve as a description or summary of the diagram's purpose. Ideally, this text should appear as a standalone block, without a visible border, and it shouldn’t interfere with the layout of participants or other elements.

I've already tried using note, but it doesn't give me the desired placement or styling.
The title option isn’t suitable either for my use case.

Is there a clean and simple way to achieve this in PlantUML? I’d really appreciate hearing how others have solved this.

Thanks in advance!

Best regards,
Omar

2 Answers

+1 vote
answered Jun 13, 2025 by Omar Medina
selected Jun 16, 2025 by The-Lu
 
Best answer
@startuml

<style>
header {
HorizontalAlignment left
FontSize 26
FontColor black
Margin 30
}
</style>

left header
   This sequence diagram illustrates the event-driven interaction between the Tree Control and Notebook
   following a tree item activation. It highlights the use of `wxQueueEvent` to asynchronously
   dispatch events, ensuring structured communication between components.
   
   The process consists of:
   - Detecting a tree item double-click (`OnItemActivated()`).
   - Applying a locking mechanism to prevent redundant execution.
   - Retrieving associated tree item data (`GetItemData()`).
   - Validating the presence of the item data (`dPtr != nullptr`).
   - If the notebook page does not exist:
       - A new `AuiNotebookSplitter` instance is allocated.
       - The new page is added to the Notebook.
endheader

actor Actor
participant wxApp
participant "TreeCtrl_ElmFiles" as TreeCtrl
participant "AuiNotebook" as Notebook
participant "AuiNotebookSplitter" as NotebookSplitter
participant "JsonParserThread" as JsonThread

@enduml
0 votes
answered Jun 13, 2025 by The-Lu (88,340 points)

Hello O.,

  • What is your kind of diagram?

Then here is a proposal using `header`, like:

@startuml
header 
A short text box
at the top of my PlantUML diagram
without a border
end header

a -> b : hello

@enduml

See also doc. here:

Enjoy,
Regards,
Th.

commented Jun 16, 2025 by Omar Medina (160 points)
Hello The-Lu,

Thank you for the information you provided—I'm aware of the details you shared.

My intention was to demonstrate, with a simple example, how a diagram description could be added consisting of several lines with left alignment.

The example you posted appears right-aligned, which doesn’t display well, especially when the content includes a list.

This isn't just a documentation detail. The example I provided was meant to illustrate how to include a left-aligned description effectively within a diagram.

If you feel it’s not useful, feel free to delete it.

Best regards,
Omar
...