Text alignment in Activity Diagram

0 votes
asked Aug 25, 2025 in Wanted features by slaszo (120 points)

I have checked in the Language Reference Guide and I could not find any option to play with text alignment in the Activity box.

Let's say I have this simple diagram like below:

@startuml
:Hello world;
:This is defined on
several **lines**;
@enduml 

By default it is aligned to the left.
It would be great to be able set the label alignment as 'centered'/'left' /'right'.

If you know any way to do it with the current version of plantUML please let me know.

Thanks

1 Answer

0 votes
answered Aug 25, 2025 by Thomas Wenzlaff
selected Aug 25, 2025 by slaszo
 
Best answer
@startuml
skinparam defaultTextAlignment center

:Hello world;
:This is defined on
several **lines**;
@enduml
commented Aug 26, 2025 by The-Lu (89,080 points)

Or by style (because skinparam will be deprecated)

@startuml
<style>
element {HorizontalAlignment center}
</style>

:Hello world;
:This is defined on
several **lines**;
@enduml

Regards,
Th.

...