PlantUML reference
What the PlantUML in our Confluence diagrams app draws: each kind of diagram and its start line, every line of the editor's syntax reference, and the limits. For a gentle start, read Learn PlantUML first.
On this page
The kinds of diagram
The editor has an example of each kind below. The first eight are
buttons; the rest are under More…. The start line
is the diagram's first line, and its end line matches it:
@startuml ends with @enduml,
@startgantt with @endgantt, and so on.
| In the editor | Kind | Start line | Where |
|---|---|---|---|
| Sequence | Sequence diagram | @startuml | Button |
| Class | Class diagram | @startuml | Button |
| Activity | Activity diagram | @startuml | Button |
| Component | Component diagram | @startuml | Button |
| State | State diagram | @startuml | Button |
| Use case | Use case diagram | @startuml | Button |
| Gantt | Gantt chart | @startgantt | Button |
| Mind map | Mind map | @startmindmap | Button |
| Deployment | Deployment diagram | @startuml | More… |
| C4 | C4 model diagram, with the C4 library | @startuml | More… |
| Object | Object diagram | @startuml | More… |
| Entity relationship | Entity relationship diagram | @startuml | More… |
| Chen ER | Entity relationship diagram in Chen's notation | @startchen | More… |
| Timing | Timing diagram | @startuml | More… |
| Network | Network diagram | @startnwdiag | More… |
| Work breakdown | Work breakdown structure | @startwbs | More… |
| JSON | JSON data | @startjson | More… |
| YAML | YAML data | @startyaml | More… |
| Wireframe | Wireframe (Salt) | @startsalt | More… |
| ArchiMate | ArchiMate diagram | @startuml | More… |
| EBNF | EBNF grammar | @startebnf | More… |
| Regex | Regular expression | @startregex | More… |
Libraries
Three libraries ship with the app. Write the include line with the library's name in angle brackets, on a line after the start line. Nothing is fetched from the web.
C4
For C4 model diagrams of a system's people, containers and links.
The editor's C4 example, under
More…, starts with
!include <C4/C4_Container>. Its lines are in
the C4 table below. C4 colors its own boxes,
so a C4 diagram is put on a light ground, like a diagram with a
light theme. A C4 include from a web address gets "write
!include <C4/…> instead".
ArchiMate
!include <archimate/Archimate>, then the
library's own words, such as
Business_Actor(customer, "Customer"). The editor's
ArchiMate example uses PlantUML's own
archimate keyword and needs no include.
Kubernetes
The Kubernetes sprites. Include a set, such as
!include <kubernetes/k8s-sprites-unlabeled-25pct>,
then put a sprite in a label as <$pod> or
<$svc>. The sets are
k8s-sprites-unlabeled-25pct, -50pct and
-full, and the same three as
k8s-sprites-labeled-….
Other libraries, such as AWS, Azure and the icon sets, are not included (see What is not drawn).
Every line, by kind
These are the lines the editor's Syntax reference shows, kind by kind. The editor shows only the list for the kind you are writing. A "…" stands for text of your own. Each line was drawn with the app's PlantUML, inside a diagram of its kind, before this page was published.
Any diagram
| Write | What it does |
|---|---|
@startuml |
The frame every diagram is written in |
title Orders |
A title |
' not drawn |
A comment: a line that starts with an apostrophe |
Alice -> Bob : Hello |
A note |
participant Bob #LightBlue |
A color, by name or as #RRGGBB |
skinparam backgroundColor #FEFEFE |
A setting for the whole drawing |
!theme cerulean |
A theme, on a line of its own after the first: one of 43, such as plain, mono, cerulean, materia, cyborg, hacker |
Sequence diagram
| Write | What it does |
|---|---|
participant Bob |
Declare a participant (also actor, database, queue) |
Alice -> Bob : Hello |
Solid arrow with a message |
Bob --> Alice : Hi back |
Dashed reply arrow |
Alice ->> Bob : Async |
Thin arrowhead |
Alice -> Alice : Think |
A message to itself |
activate Bob |
Show Bob as busy |
alt Success |
Alternatives (also opt, loop, par) |
note over Alice, Bob : … |
Note spanning participants |
== Next phase == |
A divider |
autonumber |
Number the messages |
Class diagram
| Write | What it does |
|---|---|
class Order { |
Fields and methods: + public, - private, # protected |
interface Repository |
An interface (also abstract class, enum) |
enum Status { |
An enumeration |
class Money <<value>> |
A stereotype |
Entity <|-- Order |
Inheritance |
Repository <|.. OrderRepository |
Implementation |
Order *-- OrderLine |
Composition |
Customer o-- Order |
Aggregation |
Order --> Status |
Association |
Customer "1" --> "*" Order : places |
Multiplicities and a label |
Activity diagram
| Write | What it does |
|---|---|
start |
The start (stop for the end) |
:Receive request; |
An action: text between : and ; |
if (Approved?) then (yes) |
A decision |
while (More items?) is (yes) |
A loop |
fork |
In parallel |
partition "Shipping" { |
A named part |
Component diagram
| Write | What it does |
|---|---|
[Shop] |
A component |
component "Order service" as Orders |
A component with a short name |
package "Services" { |
A group (also node, cloud, folder, frame) |
database "Orders DB" as DB |
A database |
interface API |
An interface |
[Shop] --> [Orders] : REST |
An arrow with a label |
[Shop] ..> API |
A dotted arrow |
[Shop] - [Orders] |
A line, side by side |
State diagram
| Write | What it does |
|---|---|
[*] --> Draft |
The start |
Draft --> Review : submit |
A transition with its trigger |
Review --> [*] |
The end |
Draft : waiting for an author |
Text inside a state |
state Review { |
States inside a state |
state Check <<choice>> |
A decision point |
Use case diagram
| Write | What it does |
|---|---|
actor Customer |
An actor |
usecase "Place order" as UC1 |
A use case with a short name |
(Track order) |
A use case, written short |
rectangle Shop { |
The system boundary |
Customer --> (Place order) |
An actor uses it |
(Place order) ..> (Pay) : <<include>> |
One includes another |
left to right direction |
Lay the diagram out sideways |
Gantt chart
| Write | What it does |
|---|---|
Project starts 2026-08-03 |
The first day |
[Design] lasts 7 days |
A task and how long it takes |
[Build] lasts 10 days |
One task after another |
[Release] happens at [Design]'s end |
A milestone |
[Design] lasts 7 days |
Progress |
saturday are closed |
Days nobody works |
-- Phase two -- |
A heading between tasks |
Mind map
| Write | What it does |
|---|---|
* Release |
The center: one star |
* Release |
A star more for each level |
* Release |
What follows goes to the left |
* Release |
A color |
* Release |
A branch without a box |
Deployment diagram
| Write | What it does |
|---|---|
node "Web server" as W |
A machine |
database "Database" as D |
A database |
cloud "Cloud" { |
A group (also folder, frame, package) |
artifact "app.jar" |
Something deployed |
node A |
An arrow with a label |
node A |
A dotted line |
C4 model diagram, with the C4 library
| Write | What it does |
|---|---|
!include <C4/C4_Container> |
Bring in C4, on a line after @startuml: C4_Context, C4_Container, C4_Component, C4_Dynamic, C4_Deployment or C4_Sequence |
Person(admin, "Admin", "Runs the shop") |
A person: a name to refer to, a label, a description |
System(shop, "Web shop", "Takes orders") |
A system |
System_Ext(pay, "Payments") |
A system outside your own (also Person_Ext, Container_Ext) |
Container(api, "API", "Node.js", "Orders and payments") |
A container, with its technology |
ContainerDb(db, "Database", "PostgreSQL") |
A database (also ContainerQueue) |
System_Boundary(b, "Web shop") { |
A boundary around what belongs together |
Rel(customer, web, "Uses", "HTTPS") |
An arrow from one to the other, with a label and a technology |
Rel_R(customer, web, "Uses") |
An arrow that goes right (also Rel_L, Rel_U, Rel_D) |
LAYOUT_LEFT_RIGHT() |
Lay the diagram out left to right |
SHOW_LEGEND() |
A legend of the kinds used, on the last line |
Object diagram
| Write | What it does |
|---|---|
object Order01 |
An object |
object Order01 { |
With its values |
map Settings { |
A table of keys and values |
object A |
One holds the other (also --, o--, -->) |
Entity relationship diagram
| Write | What it does |
|---|---|
entity Customer { |
An entity: a star marks what must be filled in, -- sets the key apart |
Customer ||--o{ Order |
One to many |
Customer ||--|| Account |
One to one |
Order }o--o{ Product |
Many to many |
Customer ||--o{ Order : places |
With a label |
Entity relationship diagram in Chen's notation
| Write | What it does |
|---|---|
entity Customer { |
An entity and its attributes |
relationship PLACES { |
A relationship |
entity Customer { |
One |
entity Order { |
Many |
Timing diagram
| Write | What it does |
|---|---|
robust "Server" as S |
A line with named levels |
concise "User" as U |
A line of states in a row |
concise "User" as U |
A moment, and a state at it |
concise "User" as U |
A later moment |
Network diagram
| Write | What it does |
|---|---|
nwdiag { |
A network and a machine on it |
nwdiag { |
Addresses |
nwdiag { |
A machine on two networks |
Work breakdown structure
| Write | What it does |
|---|---|
* Release |
The top: one star |
* Release |
A star more for each level |
* Release |
A box drawn to the left |
* Release |
A color |
JSON data
| Write | What it does |
|---|---|
{ |
Write the data as it is |
#highlight "paid" |
Mark one key |
YAML data
| Write | What it does |
|---|---|
order: 1042 |
Write the data as it is |
lines: |
A list |
Wireframe (Salt)
| Write | What it does |
|---|---|
{ |
A grid in braces: | starts the next column, quotes make a text field |
{ |
Buttons |
{ |
Radio buttons |
{ |
Checkboxes |
{ |
A drop-down list |
ArchiMate diagram
| Write | What it does |
|---|---|
archimate #Business "Customer" as customer <<business-actor>> |
A business element |
archimate #Application "Order service" as orders <<application-component>> |
An application element |
archimate #Technology "App server" as server <<technology-device>> |
A technology element |
archimate #Business "A" as a <<business-actor>> |
A relation |
EBNF grammar
| Write | What it does |
|---|---|
sign = "+" | "-"; |
A rule: a name, =, what it is, and ; |
number = digit, { digit }; |
A comma joins, braces repeat |
signed = [ "-" ], "1"; |
Square brackets: may be left out |
bit = ( "0" | "1" ); |
Round brackets group |
Regular expression
| Write | What it does |
|---|---|
[0-9]+ |
Write the expression itself, one to a diagram |
(yes|no) |
Alternatives |
ab?c |
An optional part |
Themes
!theme cerulean, on a line of its own after the start
line, draws the whole diagram in a theme. The app has 43, such as
plain, mono, cerulean,
materia, cyborg and
hacker. A theme made for a dark background is put on
a dark panel on a light page, and the other way round. Themes
whose license does not allow it are not included.
On Auto, a themed diagram is put on the ground its
theme is made for. Choose Light or
Dark to pick the ground yourself. Two themes,
black-knight and sketchy, read poorly on
either ground in this version of PlantUML. A theme name the app
does not have gets "There is no theme called … here".
Icons and emoji
<&heart> inside a label draws an Open
Iconic icon, and <:smile:> an emoji. Both sets
ship with the app. An emoji name the set does not have stops the
whole diagram, so check the spelling if a diagram with an emoji
will not draw.
What is not drawn
-
Graphviz graphs (
@startdot), ditaa (@startditaa) and formulas (@startmath,@startlatex). The editor and the page say "This kind of diagram is not drawn here", with the kind. -
A network diagram inside
@startuml. It is drawn with@startnwdiag. -
A formula inside a label (
<math>,<latex>) is shown as its text. - Libraries other than C4, ArchiMate and Kubernetes, such as AWS, Azure and the icon sets. The editor says "This diagram asks for … which this app does not include", with the library's name.
- Files, themes or pictures from a web address or a folder. The editor says "A diagram is drawn from its own text alone. This app fetches no file, theme or picture from an address or a folder."
Limits
- The largest side of a drawing is 16,384 pixels. A larger diagram gets "This diagram is too large to draw", with its size.
- Diagrams are laid out by PlantUML's built-in layout. Some PlantUML tools use Graphviz for class, component and use case diagrams, so the same text can be arranged a little differently there.
- Alt text is up to 250 characters. The editor keeps up to five earlier versions of a diagram's text.
- Readable (automatic) size shrinks a PlantUML diagram to three quarters of its size at most, so its text stays readable; a wider one scrolls sideways.
Which PlantUML
The app draws with PlantUML 1.2026.10, the @plantuml/core build of PlantUML for the browser, which ships inside the app. Diagrams are drawn in the reader's browser. PlantUML's own language guide has more options for each kind than the editor's reference lists; most of them work, within the limits above.