PlantUML 30 small tricks and features

puml.online

There are PlantUML features you always have to look up in the docs. This article collects 30 micro-features so you stop searching the manual every time.

1. Newlines in node names

1
2
3
4
5
6
@startuml
class "Class\nName" as c1
class Class<<
Long>> as c2
note right of c1 : multi\nline
@enduml

\n works in names AND notes.

2. Unicode characters

1
2
3
4
5
6
7
8
@startuml
note right
✓ Yes
✗ No
→ Next
⏵ Play
end note
@enduml

Emoji and unicode just work in labels.

3. Direction arrows

1
2
3
4
5
6
@startuml
A -right-> B
A -left-> C
A -up-> D
A -down-> E
@enduml

-right-> / -left-> / -up-> / -down-> force arrow direction.

4. Arrow color

1
2
3
4
5
@startuml
A -[#A31F34]-> B : red
A -[#2F4858]-> C : dark blue
A -[#20A464]-> D : green
@enduml

-[#hex]-> colors the arrow.

5. Arrow thickness

1
2
3
4
5
@startuml
A -> B : default
A ->[thickness=2] C : thicker
A ->[thickness=4] D : thickest
@enduml

6. Arrow style

1
2
3
4
5
@startuml
A -[#A31F34,bold]-> B : red bold
A -[#2F4858,dashed]-> C : dashed
A -[bold,dashed]-> D : both
@enduml

bold / dashed / dotted modifiers.

7. Node color

1
2
3
4
5
6
7
@startuml
class A #A31F34
class B #FAFAFA/A31F34 : bg / border
class C #FAFAFA {
Field1
}
@enduml

#background or #bg/border.

8. Group nodes

1
2
3
4
5
6
7
8
9
10
11
12
@startuml
package "Frontend" {
class A
class B
}
package "Backend" {
class C
class D
}
A --> C
B --> D
@enduml

9. Notes

1
2
3
4
5
6
7
8
9
10
11
12
@startuml

A
note left: left
note right: right
note top: top
note bottom: bottom

A .. B
note over A, B : spanning

@enduml

note over A, B is a horizontal spanning note.

10. Multi-line note

1
2
3
4
5
6
7
8
9
10
11
@startuml

class A

note left of A
multi-line note
second line
third line
end note

@enduml

11. Global style

1
2
3
4
5
6
7
8
@startuml
skinparam class {
BackgroundColor #FAFAFA
BorderColor #2F4858
FontColor #1F2328
ArrowColor #2F4858
}
@enduml

skinparam controls global style.

12. Hide circles (interface indicators)

1
2
3
4
5
6
@startuml
hide circle
class A
class B
A --> B
@enduml

hide circle removes interface holler circles on relation arrows.

13. Emoji in class

1
2
3
4
5
@startuml
class "🚀 Rocket" as r
class "🐛 Bug" as b
r --> b : ship
@enduml

14. Group fields / methods

1
2
3
4
5
6
7
8
9
10
@startuml
class User {
+name: String
+email: String
{field} -id: Long
--
{method} +login()
{method} +logout()
}
@enduml

{field} / {method} group members in the rendered output.

15. Stereotypes

1
2
3
4
5
6
@startuml
class Foo <<(M, #A31F34) Magic>>
class Bar <<service>>
abstract class Abs
interface Inf
@enduml

<<type>> for stereotypes; (X, #color) Label for custom.

16. Generics

1
2
3
4
5
@startuml
class Foo<T>

note right : generic\nFoo<T>
@enduml

<> expresses a generic class.

17. Collection types

1
2
3
4
5
6
7
@startuml
class User {
+roles: List<String>
+scores: Map<String, Integer>
+data: byte[]
}
@enduml

Generics inline.

18. Note colors

1
2
3
4
5
6
7
@startuml
class Foo

note top of Foo : plain note
note top of Foo #FAFAFA : colored note

@enduml

19. Layout direction

1
2
3
4
5
6
7
8
9
@startuml
hide footbox
title Right-going timeline

a -> b
b --> c
c <-- d

@enduml

hide footbox removes the time-axis.

20. Box groups in sequence

1
2
3
4
5
6
7
8
9
10
11
12
@startuml
box "Client" #FAFAFA
participant Browser
end box
box "Server" #FFFFFF
participant API
participant DB
end box

Browser -> API
API -> DB
@enduml

box groups lifelines; bg color available.

21. Scale

1
2
3
4
5
@startuml
scale 2
class A
class B
@enduml

scale 2 enlarges by 2x.

22. Nested states

1
2
3
4
5
6
7
8
9
10
@startuml

class Order

state New {
* -> Created
Created -> Confirmed
}

@enduml

In state diagrams, state X { ... } for nested.

23. Interface realization

1
2
3
4
5
6
7
8
@startuml

interface ILoggable
class Service

Service ..|> ILoggable

@enduml

Realization is ..|> (dashed + open triangle).

24. Character escape

1
2
3
4
@startuml
class "Class\#1" as c1
note "with # \\ chars" as n
@enduml

\\ escapes backslash; some # need escaping.

25. “Architectural” style skinparam

1
2
3
4
5
6
7
8
9
10
11
@startuml
skinparam {
Shadowing false
RoundCorner 0
DefaultFontName "Menlo"
BackgroundColor #FAFAFA
}

class A
A ..> B : dotted
@enduml

26. Orthogonal lines

1
2
3
4
5
6
@startuml
skinparam linetype ortho
A -> B
B -> C
C -> D
@enduml

linetype ortho forces right-angle connections.

27. Manual line breaks

1
2
3
@startuml
class "a\nlong\nname" as c1
@enduml

\n in any string.

28. Hide stereotypes globally

1
2
3
4
5
6
@startuml
hide stereotype
class A <<service>>
class B <<controller>>
A -> B
@enduml

hide stereotype removes <<X>> labels from rendered output.

29. Layout direction

1
2
3
4
5
6
7
8
@startuml
left to right direction

class A
class B
class C
A --> B --> C
@enduml

top to bottom direction / left to right direction.

1
2
3
4
@startuml
hide footer
class A
@enduml

Controls which decoration elements to print.

Review checklist

  • Diagram uses consistent skinparam?
  • Color palette ≤ 5 colors?
  • Arrow direction clear?
  • Notes use \n, not raw line breaks?
  • Labels are verb-phrases?

TL;DR

PlantUML has plenty of obscure syntax. These 30 micro-features cover the most-asked-about tweaks; reach for them when you’re stuck, save yourself the docs spelunking.

  • Title: PlantUML 30 small tricks and features
  • Author: puml.online
  • Created at : 2026-07-29 16:30:00
  • Updated at : 2026-08-14 21:34:29
  • Link: https://puml.online/blog/plantuml-tips-tricks-en/
  • License: This work is licensed under CC BY-NC-SA 4.0.