Following the work from
Brett Schwarz, we have integrated several themes into
the main core library.
Since those themes are included into the library, it is working out of the box: you don't need to install anything on your side. You just have to use the
!theme
directive:
🎉 Copied! ![Copy to clipboard](https://plantuml.com/clipboard1.svg)
![Edit online](https://plantuml.com/edit1.svg) | @startuml
!theme spacelab
class Example {
Theme spacelab
}
@enduml
|
🎉 Copied! ![Copy to clipboard](https://plantuml.com/clipboard1.svg)
![Edit online](https://plantuml.com/edit1.svg) | @startuml
!theme spacelab
a -> b
b -> c
@enduml
|
Several websites are listing available themes:
Finally, you can list all available themes from your PlantUML library:
🎉 Copied! ![Copy to clipboard](https://plantuml.com/clipboard1.svg)
![Edit online](https://plantuml.com/edit1.svg) | @startuml
help themes
@enduml
|
Some theme includes some procedures, to help coloring message, as:
$success("<msg>")
$failure("<msg>")
$warning("<msg>")
Example:
🎉 Copied! ![Copy to clipboard](https://plantuml.com/clipboard1.svg)
![Edit online](https://plantuml.com/edit1.svg) | @startuml
!theme spacelab
Bob -> Alice : hello
Bob <- Alice : $success("success: hello B.")
Bob -x Alice : $failure("failure")
Bob ->> Alice : $warning("warning")
@enduml
|
You can create your own theme on your local file system. You can
duplicate any existing theme to create your own one.
By default, a theme file is named
puml-theme-foo.puml
where
foo
is the name of the theme.
To invoke a local theme, you have to use the following directive:
!theme foo from /path/to/themes/folder
Other repositories can also publish themes for PlantUML.
Theme files must follow the same convention:
puml-theme-foo.puml
where
foo
is the name of the theme.
To use a theme from a remote repository, you have to use the following directive:
!theme amiga from https://raw.githubusercontent.com/plantuml/plantuml/master/themes
If you find any interesting theme, you can also propose a pull request so that we integrate this theme into
the main core library.