Search

Dark theme | Light theme

October 23, 2017

PlantUML Pleasantness: Using The Built-in Icons

PlantUML has a built-in icon set we can use in our diagram definitions. The icon set is open source icon set OpenIconic. We refer to an icon using the syntax <&iconName>.We can use an icon everywhere where we can use text in our diagrams.

In the following example we use different icons in different places:

 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
@startuml
 
skinparam DefaultFontSize 24
skinparam DefaultTextAlignment center
 
title <&caret-right> Using icons in PlantUML <&caret-left>
 
package "Charts <&menu>" as charts {
 
    file bar [
        Bar
 
        <size:120><&bar-chart></size>
    ]
 
    file pie [
        Pie
 
        <size:42><&pie-chart></size>
    ]
 
}  
 
@enduml

When we generate a diagram we see the following output:

To get a list of available icons we can use the statement listopeniconic. This will create a diagram with all the icons and their names we can use:

 
1
2
@startuml
listopeniconic
@enduml

The following image shows all icons that we can use:

Written with PlantUML 1.2017.18.