PlantUML Template Gallery

30 copy-ready snippets grouped for quick use. Click “Copy” and paste into your editor.

Core

10

Must-know UML building blocks for quick starts.

sequence
@startuml
title Sample Sequence
actor User
participant Browser
participant Server
User -> Browser: type diagram
Browser -> Server: POST /render
Server --> Browser: SVG/PNG
note right: Hello PlantUML!
@enduml
sequence-alt
@startuml
title Sequence with alt/else
Alice -> Bob: request
alt OK
  Bob --> Alice: 200 OK
else Error
  Bob --> Alice: 400 Error
end
@enduml
sequence-async
@startuml
title Async Interaction
actor Client
participant API
Client -> API ++ : fire & forget
... processing ...
API --> Client -- : callback (optional)
@enduml
class
@startuml
title Sample Class
class User {
  +id: int
  +name: string
  +login()
}
class Session {
  +token: string
  +expiresAt: DateTime
}
User "1" -- "0..*" Session : owns >
@enduml
object
@startuml
title Object Diagram
object "User #1" as U1 {
  id = 1
  name = "Alice"
}
object "Session A" as S1 { token = "abc..." }
U1 -- S1 : has
@enduml
package
@startuml
title Package Diagram
package "Core" { class A
class B }
package "Feature" { class C }
A --> B
B --> C
@enduml
activity
@startuml
title Sample Activity
start
:Input text;
if (Valid?) then (yes)
  :Encode;
  :Render;
else (no)
  :Show error;
endif
stop
@enduml
state
@startuml
title Sample State
[*] --> Editing
Editing --> Preview : click Render
Preview --> Editing : modify
Preview --> [*] : export
@enduml
usecase
@startuml
title Sample Use Case
left to right direction
actor User
rectangle System {
  usecase "Create Diagram" as UC1
  usecase "Export PNG/SVG" as UC2
}
User --> UC1
User --> UC2
@enduml
er
@startuml
title Sample ER Model
entity "User" as U {
  * id : int <<PK>>
  --
  name : varchar
}
entity "Session" as S {
  * token : varchar <<PK>>
  --
  user_id : int <<FK>>
}
U ||--o{ S : has
@enduml

Advanced

8

Sequences, components, and flows for real systems.

sequence-rest
@startuml
title REST Request/Response
participant Client
participant API
database DB
Client -> API: GET /items
API -> DB: SELECT * FROM items
DB --> API: rows
API --> Client: 200 OK (JSON)
@enduml
class-advanced
@startuml
title Advanced Class
interface AuthService
class JwtAuth implements AuthService
class Repository<T>
class UserRepo extends Repository<User>
class User { +id: int +email: string +login() }
AuthService <|.. JwtAuth
Repository <|-- UserRepo
UserRepo --> User
@enduml
activity-swimlane
@startuml
title Activity with Swimlanes
|User|
start
:Fill form;
|System|
:Validate;
if (OK?) then (yes)
  |User|
  :Confirm;
else (no)
  |System|
  :Show error;
endif
stop
@enduml
component-interfaces
@startuml
title Component with Interface
interface "HTTP" as IHTTP
component "Web UI" as UI
component "API" as API
UI - IHTTP
IHTTP - API
@enduml
deployment
@startuml
title Deployment Diagram
node "Client" { artifact "Browser" }
node "Server" {
  component "Web"
  component "API"
}
"Browser" --> "Web"
"Web" --> "API"
@enduml
state-nested
@startuml
title Nested State
[*] --> Auth
state Auth {
  [*] --> Login
  Login --> TwoFA : success
  TwoFA --> [*] : ok
}
Auth --> Dashboard
Dashboard --> [*]
@enduml
timing
@startuml
title Timing Diagram
robust "Client" as C
robust "Server" as S
@0
C is Idle
S is Idle
@10
C is Sending
@20
S is Processing
@30
C is Idle
S is Idle
@enduml
communication
@startuml
title Communication
object Client
object Service
object Cache
Client -> Service : request
Service -> Cache : get(key)
Cache --> Service : value/miss
Service --> Client : response
@enduml

PM / Docs

6

Mindmap, WBS, Gantt, and UI mockups for docs.

mindmap
@startmindmap
* Project
** Backend
*** API
*** Database
** Frontend
*** Web
*** Mobile
@endmindmap
wbs
@startwbs
* Launch
** Design
*** UX
*** UI
** Build
*** Backend
*** Frontend
** QA
*** Unit
*** E2E
@endwbs
gantt
@startgantt
Project starts 2025-09-01
[Design] lasts 5 days
[Build] starts at [Design]'s end and lasts 10 days
[Test] starts at [Build]'s end and lasts 4 days
@endgantt
salt-login
@startsalt
{+
  "Login"
  Username | [__________]
  Password | [__________]
  { "" | [  Login  ] }
}
@endsalt
json
@startjson
{
  "user": {
    "id": 1,
    "name": "Alice",
    "roles": ["admin","editor"]
  }
}
@endjson
yaml
@startyaml
user:
  id: 1
  name: Alice
  roles:
    - admin
    - editor
@endyaml

DevOps / Infra

3

Cloud, C4-lite, and queue/worker basics.

deployment-cloud
@startuml
title Cloud Deployment
node "Client" { artifact "Browser" }
cloud "Internet"
node "Kubernetes" {
  node "Pod" {
    artifact "web"
    artifact "api"
  }
}
"Browser" --> "Internet"
"Internet" --> "web"
"web" --> "api"
@enduml
c4-container-lite
@startuml
title C4 Container (Lite)
' https://c4model.com (simplified)
Person(user, "User")
Container(web, "Web App", "Next.js")
Container(api, "API", "Node.js")
ContainerDb(db, "DB", "PostgreSQL")
Rel(user, web, "Uses")
Rel(web, api, "HTTP")
Rel(api, db, "SQL")
@enduml
queue-worker
@startuml
title Queue & Worker
actor Producer
queue "Job Queue" as Q
participant Worker
Producer -> Q ++ : enqueue(job)
Q --> Worker : job
Worker --> Producer : result
@enduml

Data / Integration

3

ETL, sharding, and event-driven blueprints.

db-sharding
@startuml
title DB Sharding
database "Router" as R
database "Shard A" as A
database "Shard B" as B
R --> A : key in range A
R --> B : key in range B
@enduml
etl-pipeline
@startuml
title ETL Pipeline
rectangle Extract
rectangle Transform
database Load as L
Extract --> Transform
Transform --> L : upsert
@enduml
event-driven
@startuml
title Event-driven
actor Producer
queue "Kafka Topic" as T
participant Consumer
Producer -> T ++ : publish(event)
T --> Consumer : consume
@enduml