Skip to content

Render Options

See the official C4-PlantUML Layout Options documentation for additional information.

c4.renderers.plantuml.options.PlantUMLRenderOptionsBuilder

Builder class for constructing PlantUMLRenderOptions.

Provides a fluent API for incrementally defining styles and layout configuration.

add_element_tag

add_element_tag(
    tag_stereo: str | None = None,
    bg_color: str | None = None,
    font_color: str | None = None,
    border_color: str | None = None,
    shadowing: bool | None = None,
    shape: TagShape | None = None,
    sprite: str | None = None,
    technology: str | None = None,
    legend_text: str | None = None,
    legend_sprite: str | None = None,
    border_style: LineStyle | None = None,
    border_thickness: str | None = None,
) -> Self

Adds an AddElementTag() macro configuration.

Parameters:

Name Type Description Default
tag_stereo str | None

The tag stereotype name.

None
bg_color str | None

Background color.

None
font_color str | None

Font color.

None
border_color str | None

Border color.

None
shadowing bool | None

Shadow effect setting.

None
shape TagShape | None

Optional shape modifier.

None
sprite str | None

Optional sprite reference.

None
technology str | None

Technology metadata.

None
legend_text str | None

Legend label.

None
legend_sprite str | None

Legend sprite.

None
border_style LineStyle | None

Border style.

None
border_thickness str | None

Border thickness.

None

Returns:

Type Description
Self

The updated render options.

add_boundary_tag

add_boundary_tag(
    tag_stereo: str | None = None,
    bg_color: str | None = None,
    font_color: str | None = None,
    border_color: str | None = None,
    shadowing: bool | None = None,
    shape: TagShape | None = None,
    sprite: str | None = None,
    type_: str | None = None,
    legend_text: str | None = None,
    legend_sprite: str | None = None,
    border_style: LineStyle | None = None,
    border_thickness: str | None = None,
) -> Self

Adds an AddBoundaryTag() macro configuration.

Parameters:

Name Type Description Default
tag_stereo str | None

The tag stereotype name.

None
bg_color str | None

Background color.

None
font_color str | None

Font color.

None
border_color str | None

Border color.

None
shadowing bool | None

Shadow effect setting.

None
shape TagShape | None

Optional shape modifier.

None
sprite str | None

Optional sprite reference.

None
type_ str | None

Boundary type.

None
legend_text str | None

Legend label.

None
legend_sprite str | None

Legend sprite.

None
border_style LineStyle | None

Border style.

None
border_thickness str | None

Border thickness.

None

Returns:

Type Description
Self

The updated render options.

add_rel_tag

add_rel_tag(
    tag_stereo: str | None = None,
    text_color: str | None = None,
    line_color: str | None = None,
    sprite: str | None = None,
    technology: str | None = None,
    legend_text: str | None = None,
    legend_sprite: str | None = None,
    line_style: LineStyle | None = None,
    line_thickness: str | None = None,
) -> Self

Adds an AddRelTag() macro configuration.

Parameters:

Name Type Description Default
tag_stereo str | None

The tag stereotype name.

None
text_color str | None

Text color.

None
line_color str | None

Line color.

None
sprite str | None

Optional sprite reference.

None
technology str | None

Technology metadata.

None
legend_text str | None

Legend label.

None
legend_sprite str | None

Legend sprite.

None
line_style LineStyle | None

Line style.

None
line_thickness str | None

Line thickness.

None

Returns:

Type Description
Self

The updated render options.

add_component_tag

add_component_tag(
    tag_stereo: str | None = None,
    bg_color: str | None = None,
    font_color: str | None = None,
    border_color: str | None = None,
    shadowing: bool | None = None,
    shape: TagShape | None = None,
    sprite: str | None = None,
    technology: str | None = None,
    legend_text: str | None = None,
    legend_sprite: str | None = None,
    border_style: LineStyle | None = None,
    border_thickness: str | None = None,
) -> Self

Adds an AddComponentTag() macro configuration.

Parameters:

Name Type Description Default
tag_stereo str | None

The tag stereotype name.

None
bg_color str | None

Background color.

None
font_color str | None

Font color.

None
border_color str | None

Border color.

None
shadowing bool | None

Shadow effect setting.

None
shape TagShape | None

Optional shape modifier.

None
sprite str | None

Optional sprite reference.

None
technology str | None

Technology metadata.

None
legend_text str | None

Legend label.

None
legend_sprite str | None

Legend sprite.

None
border_style LineStyle | None

Border style.

None
border_thickness str | None

Border thickness.

None

Returns:

Type Description
Self

The updated render options.

add_external_component_tag

add_external_component_tag(
    tag_stereo: str | None = None,
    bg_color: str | None = None,
    font_color: str | None = None,
    border_color: str | None = None,
    shadowing: bool | None = None,
    shape: TagShape | None = None,
    sprite: str | None = None,
    technology: str | None = None,
    legend_text: str | None = None,
    legend_sprite: str | None = None,
    border_style: LineStyle | None = None,
    border_thickness: str | None = None,
) -> Self

Adds an AddExternalComponentTag() macro configuration.

Parameters:

Name Type Description Default
tag_stereo str | None

The tag stereotype name.

None
bg_color str | None

Background color.

None
font_color str | None

Font color.

None
border_color str | None

Border color.

None
shadowing bool | None

Shadow effect setting.

None
shape TagShape | None

Optional shape modifier.

None
sprite str | None

Optional sprite reference.

None
technology str | None

Technology metadata.

None
legend_text str | None

Legend label.

None
legend_sprite str | None

Legend sprite.

None
border_style LineStyle | None

Border style.

None
border_thickness str | None

Border thickness.

None

Returns:

Type Description
Self

The updated render options.

add_container_tag

add_container_tag(
    tag_stereo: str | None = None,
    bg_color: str | None = None,
    font_color: str | None = None,
    border_color: str | None = None,
    shadowing: bool | None = None,
    shape: TagShape | None = None,
    sprite: str | None = None,
    technology: str | None = None,
    legend_text: str | None = None,
    legend_sprite: str | None = None,
    border_style: LineStyle | None = None,
    border_thickness: str | None = None,
) -> Self

Adds an AddContainerTag() macro configuration.

Parameters:

Name Type Description Default
tag_stereo str | None

The tag stereotype name.

None
bg_color str | None

Background color.

None
font_color str | None

Font color.

None
border_color str | None

Border color.

None
shadowing bool | None

Shadow effect setting.

None
shape TagShape | None

Optional shape modifier.

None
sprite str | None

Optional sprite reference.

None
technology str | None

Technology metadata.

None
legend_text str | None

Legend label.

None
legend_sprite str | None

Legend sprite.

None
border_style LineStyle | None

Border style.

None
border_thickness str | None

Border thickness.

None

Returns:

Type Description
Self

The updated render options.

add_external_container_tag

add_external_container_tag(
    tag_stereo: str | None = None,
    bg_color: str | None = None,
    font_color: str | None = None,
    border_color: str | None = None,
    shadowing: bool | None = None,
    shape: TagShape | None = None,
    sprite: str | None = None,
    technology: str | None = None,
    legend_text: str | None = None,
    legend_sprite: str | None = None,
    border_style: LineStyle | None = None,
    border_thickness: str | None = None,
) -> Self

Adds an AddExternalContainerTag() macro configuration.

Parameters:

Name Type Description Default
tag_stereo str | None

The tag stereotype name.

None
bg_color str | None

Background color.

None
font_color str | None

Font color.

None
border_color str | None

Border color.

None
shadowing bool | None

Shadow effect setting.

None
shape TagShape | None

Optional shape modifier.

None
sprite str | None

Optional sprite reference.

None
technology str | None

Technology metadata.

None
legend_text str | None

Legend label.

None
legend_sprite str | None

Legend sprite.

None
border_style LineStyle | None

Border style.

None
border_thickness str | None

Border thickness.

None

Returns:

Type Description
Self

The updated render options.

add_node_tag

add_node_tag(
    tag_stereo: str | None = None,
    bg_color: str | None = None,
    font_color: str | None = None,
    border_color: str | None = None,
    shadowing: bool | None = None,
    shape: TagShape | None = None,
    sprite: str | None = None,
    type_: str | None = None,
    legend_text: str | None = None,
    legend_sprite: str | None = None,
    border_style: LineStyle | None = None,
    border_thickness: str | None = None,
) -> Self

Adds an AddNodeTag() macro configuration.

Parameters:

Name Type Description Default
tag_stereo str | None

The tag stereotype name.

None
bg_color str | None

Background color.

None
font_color str | None

Font color.

None
border_color str | None

Border color.

None
shadowing bool | None

Shadow effect setting.

None
shape TagShape | None

Optional shape modifier.

None
sprite str | None

Optional sprite reference.

None
type_ str | None

Node type.

None
legend_text str | None

Legend label.

None
legend_sprite str | None

Legend sprite.

None
border_style LineStyle | None

Border style.

None
border_thickness str | None

Border thickness.

None

Returns:

Type Description
Self

The updated render options.

add_person_tag

add_person_tag(
    tag_stereo: str | None = None,
    bg_color: str | None = None,
    font_color: str | None = None,
    border_color: str | None = None,
    shadowing: bool | None = None,
    shape: TagShape | None = None,
    sprite: str | None = None,
    type_: str | None = None,
    legend_text: str | None = None,
    legend_sprite: str | None = None,
    border_style: LineStyle | None = None,
    border_thickness: str | None = None,
) -> Self

Adds an AddPersonTag() macro configuration.

Parameters:

Name Type Description Default
tag_stereo str | None

The tag stereotype name.

None
bg_color str | None

Background color.

None
font_color str | None

Font color.

None
border_color str | None

Border color.

None
shadowing bool | None

Shadow effect setting.

None
shape TagShape | None

Optional shape modifier.

None
sprite str | None

Optional sprite reference.

None
type_ str | None

Person type.

None
legend_text str | None

Legend label.

None
legend_sprite str | None

Legend sprite.

None
border_style LineStyle | None

Border style.

None
border_thickness str | None

Border thickness.

None

Returns:

Type Description
Self

The updated render options.

add_external_person_tag

add_external_person_tag(
    tag_stereo: str | None = None,
    bg_color: str | None = None,
    font_color: str | None = None,
    border_color: str | None = None,
    shadowing: bool | None = None,
    shape: TagShape | None = None,
    sprite: str | None = None,
    type_: str | None = None,
    legend_text: str | None = None,
    legend_sprite: str | None = None,
    border_style: LineStyle | None = None,
    border_thickness: str | None = None,
) -> Self

Adds an AddExternalPersonTag() macro configuration.

Parameters:

Name Type Description Default
tag_stereo str | None

The tag stereotype name.

None
bg_color str | None

Background color.

None
font_color str | None

Font color.

None
border_color str | None

Border color.

None
shadowing bool | None

Shadow effect setting.

None
shape TagShape | None

Optional shape modifier.

None
sprite str | None

Optional sprite reference.

None
type_ str | None

Person type.

None
legend_text str | None

Legend label.

None
legend_sprite str | None

Legend sprite.

None
border_style LineStyle | None

Border style.

None
border_thickness str | None

Border thickness.

None

Returns:

Type Description
Self

The updated render options.

add_system_tag

add_system_tag(
    tag_stereo: str | None = None,
    bg_color: str | None = None,
    font_color: str | None = None,
    border_color: str | None = None,
    shadowing: bool | None = None,
    shape: TagShape | None = None,
    sprite: str | None = None,
    type_: str | None = None,
    legend_text: str | None = None,
    legend_sprite: str | None = None,
    border_style: LineStyle | None = None,
    border_thickness: str | None = None,
) -> Self

Adds an AddSystemTag() macro configuration.

Parameters:

Name Type Description Default
tag_stereo str | None

The tag stereotype name.

None
bg_color str | None

Background color.

None
font_color str | None

Font color.

None
border_color str | None

Border color.

None
shadowing bool | None

Shadow effect setting.

None
shape TagShape | None

Optional shape modifier.

None
sprite str | None

Optional sprite reference.

None
type_ str | None

System type.

None
legend_text str | None

Legend label.

None
legend_sprite str | None

Legend sprite.

None
border_style LineStyle | None

Border style.

None
border_thickness str | None

Border thickness.

None

Returns:

Type Description
Self

The updated render options.

add_external_system_tag

add_external_system_tag(
    tag_stereo: str | None = None,
    bg_color: str | None = None,
    font_color: str | None = None,
    border_color: str | None = None,
    shadowing: bool | None = None,
    shape: TagShape | None = None,
    sprite: str | None = None,
    type_: str | None = None,
    legend_text: str | None = None,
    legend_sprite: str | None = None,
    border_style: LineStyle | None = None,
    border_thickness: str | None = None,
) -> Self

Adds an AddExternalSystemTag() macro configuration.

Parameters:

Name Type Description Default
tag_stereo str | None

The tag stereotype name.

None
bg_color str | None

Background color.

None
font_color str | None

Font color.

None
border_color str | None

Border color.

None
shadowing bool | None

Shadow effect setting.

None
shape TagShape | None

Optional shape modifier.

None
sprite str | None

Optional sprite reference.

None
type_ str | None

System type.

None
legend_text str | None

Legend label.

None
legend_sprite str | None

Legend sprite.

None
border_style LineStyle | None

Border style.

None
border_thickness str | None

Border thickness.

None

Returns:

Type Description
Self

The updated render options.

update_element_style

update_element_style(
    element_name: str | None = None,
    bg_color: str | None = None,
    font_color: str | None = None,
    border_color: str | None = None,
    shadowing: bool | None = None,
    shape: TagShape | None = None,
    sprite: str | None = None,
    technology: str | None = None,
    legend_text: str | None = None,
    legend_sprite: str | None = None,
    border_style: LineStyle | None = None,
    border_thickness: str | None = None,
) -> Self

Adds an UpdateElementStyle() macro configuration.

Parameters:

Name Type Description Default
element_name str | None

C4 element type to style (e.g. 'person', 'system', 'container').

None
bg_color str | None

Background color.

None
font_color str | None

Font color.

None
border_color str | None

Border color.

None
shadowing bool | None

Shadow effect setting.

None
shape TagShape | None

Optional shape modifier.

None
sprite str | None

Optional sprite reference.

None
technology str | None

Technology metadata.

None
legend_text str | None

Legend label.

None
legend_sprite str | None

Legend sprite.

None
border_style LineStyle | None

Border style.

None
border_thickness str | None

Border thickness.

None

Returns:

Type Description
Self

The updated render options.

update_boundary_style

update_boundary_style(
    element_name: str | None = None,
    bg_color: str | None = None,
    font_color: str | None = None,
    border_color: str | None = None,
    shadowing: bool | None = None,
    shape: TagShape | None = None,
    type_: str | None = None,
    sprite: str | None = None,
    legend_text: str | None = None,
    legend_sprite: str | None = None,
    border_style: LineStyle | None = None,
    border_thickness: str | None = None,
) -> Self

Adds an UpdateBoundaryStyle() macro configuration.

Parameters:

Name Type Description Default
element_name str | None

C4 element type to style (e.g. 'person', 'system', 'container').

None
bg_color str | None

Background color.

None
font_color str | None

Font color.

None
border_color str | None

Border color.

None
shadowing bool | None

Shadow effect setting.

None
shape TagShape | None

Optional shape modifier.

None
type_ str | None

Element type.

None
sprite str | None

Optional sprite reference.

None
legend_text str | None

Legend label.

None
legend_sprite str | None

Legend sprite.

None
border_style LineStyle | None

Border style.

None
border_thickness str | None

Border thickness.

None

Returns:

Type Description
Self

The updated render options.

update_rel_style

update_rel_style(
    text_color: str | None = None,
    line_color: str | None = None,
) -> Self

Adds an UpdateRelStyle() macro configuration.

Parameters:

Name Type Description Default
text_color str | None

Text color.

None
line_color str | None

Line color.

None

Returns:

Type Description
Self

The updated render options.

update_container_boundary_style

update_container_boundary_style(
    bg_color: str | None = None,
    font_color: str | None = None,
    border_color: str | None = None,
    shadowing: bool | None = None,
    shape: TagShape | None = None,
    type_: str | None = None,
    sprite: str | None = None,
    legend_text: str | None = None,
    legend_sprite: str | None = None,
    border_style: LineStyle | None = None,
    border_thickness: str | None = None,
) -> Self

Adds an UpdateContainerBoundaryStyle() macro configuration.

Parameters:

Name Type Description Default
bg_color str | None

Background color.

None
font_color str | None

Font color.

None
border_color str | None

Border color.

None
shadowing bool | None

Shadow effect setting.

None
shape TagShape | None

Optional shape modifier.

None
type_ str | None

Element type.

None
sprite str | None

Optional sprite reference.

None
legend_text str | None

Legend label.

None
legend_sprite str | None

Legend sprite.

None
border_style LineStyle | None

Border style.

None
border_thickness str | None

Border thickness.

None

Returns:

Type Description
Self

The updated render options.

update_system_boundary_style

update_system_boundary_style(
    bg_color: str | None = None,
    font_color: str | None = None,
    border_color: str | None = None,
    shadowing: bool | None = None,
    shape: TagShape | None = None,
    type_: str | None = None,
    sprite: str | None = None,
    legend_text: str | None = None,
    legend_sprite: str | None = None,
    border_style: LineStyle | None = None,
    border_thickness: str | None = None,
) -> Self

Adds an UpdateSystemBoundaryStyle() macro configuration.

Parameters:

Name Type Description Default
bg_color str | None

Background color.

None
font_color str | None

Font color.

None
border_color str | None

Border color.

None
shadowing bool | None

Shadow effect setting.

None
shape TagShape | None

Optional shape modifier.

None
type_ str | None

Container type.

None
sprite str | None

Optional sprite reference.

None
legend_text str | None

Legend label.

None
legend_sprite str | None

Legend sprite.

None
border_style LineStyle | None

Border style.

None
border_thickness str | None

Border thickness.

None

Returns:

Type Description
Self

The updated render options.

update_enterprise_boundary_style

update_enterprise_boundary_style(
    bg_color: str | None = None,
    font_color: str | None = None,
    border_color: str | None = None,
    shadowing: bool | None = None,
    shape: TagShape | None = None,
    type_: str | None = None,
    sprite: str | None = None,
    legend_text: str | None = None,
    legend_sprite: str | None = None,
    border_style: LineStyle | None = None,
    border_thickness: str | None = None,
) -> Self

Adds an UpdateEnterpriseBoundaryStyle() macro configuration.

Parameters:

Name Type Description Default
bg_color str | None

Background color.

None
font_color str | None

Font color.

None
border_color str | None

Border color.

None
shadowing bool | None

Shadow effect setting.

None
shape TagShape | None

Optional shape modifier.

None
type_ str | None

Container type.

None
sprite str | None

Optional sprite reference.

None
legend_text str | None

Legend label.

None
legend_sprite str | None

Legend sprite.

None
border_style LineStyle | None

Border style.

None
border_thickness str | None

Border thickness.

None

Returns:

Type Description
Self

The updated render options.

layout_top_down

layout_top_down(*, with_legend: bool = False) -> Self

Sets the diagram layout to top-down orientation.

Parameters:

Name Type Description Default
with_legend bool

Whether to include LAYOUT_WITH_LEGEND.

False

Returns:

Type Description
Self

The updated render options.

layout_left_right

layout_left_right(*, with_legend: bool = False) -> Self

Sets the diagram layout to left-right orientation.

Parameters:

Name Type Description Default
with_legend bool

Whether to include LAYOUT_WITH_LEGEND.

False

Returns:

Type Description
Self

The updated render options.

layout_landscape

layout_landscape(*, with_legend: bool = False) -> Self

Sets the diagram layout to PlantUML landscape mode.

Parameters:

Name Type Description Default
with_legend bool

Whether to include LAYOUT_WITH_LEGEND.

False

Returns:

Type Description
Self

The updated render options.

layout_with_legend

layout_with_legend() -> Self

Enables LAYOUT_WITH_LEGEND macro.

Returns:

Type Description
Self

The updated render options.

layout_as_sketch

layout_as_sketch() -> Self

Enables LAYOUT_AS_SKETCH macro.

Returns:

Type Description
Self

The updated render options.

without_property_header

without_property_header() -> Self

Enables WithoutPropertyHeader macro.

Returns:

Type Description
Self

The updated render options.

set_sketch_style

set_sketch_style(
    bg_color: str | None = None,
    font_color: str | None = None,
    warning_color: str | None = None,
    font_name: str | None = None,
    footer_warning: str | None = None,
    footer_text: str | None = None,
) -> Self

Enables SET_SKETCH_STYLE macro with optional customization.

Parameters:

Name Type Description Default
bg_color str | None

Background color of the sketch.

None
font_color str | None

Font color.

None
warning_color str | None

Color for footer warnings.

None
font_name str | None

Font family name.

None
footer_warning str | None

Warning message in the footer.

None
footer_text str | None

Custom footer text.

None

Returns:

Type Description
Self

The updated render options.

show_legend

show_legend(
    hide_stereotype: bool = True, details: Details = "Small"
) -> Self

Enables SHOW_LEGEND macro with custom options.

Parameters:

Name Type Description Default
hide_stereotype bool

Whether to hide stereotypes in the legend.

True
details Details

Level of detail to show.

'Small'

Returns:

Type Description
Self

The updated render options.

show_floating_legend

show_floating_legend(
    alias: str | None = None,
    hide_stereotype: bool = True,
    details: Details = "Small",
) -> Self

Enables SHOW_FLOATING_LEGEND macro with custom options.

Parameters:

Name Type Description Default
alias str | None

Optional legend alias.

None
hide_stereotype bool

Whether to hide stereotypes in the legend.

True
details Details

Level of detail to show.

'Small'

Returns:

Type Description
Self

The updated render options.

update_legend_title

update_legend_title(new_title: str | None = None) -> Self

Sets a custom title for the legend.

Parameters:

Name Type Description Default
new_title str | None

The title to display above the legend.

None

Returns:

Type Description
Self

The updated render options.

show_person_outline

show_person_outline() -> Self

Enables SHOW_PERSON_OUTLINE macro.

Returns:

Type Description
Self

The updated render options.

show_person_sprite

show_person_sprite(alias: str | None = None) -> Self

Enables SHOW_PERSON_SPRITE macro with custom options.

Parameters:

Name Type Description Default
alias str | None

Optional sprite alias.

None

Returns:

Type Description
Self

The updated render options.

hide_stereotype

hide_stereotype() -> Self

Enables HIDE_STEREOTYPE macro.

Returns:

Type Description
Self

The updated render options.

hide_person_sprite

hide_person_sprite() -> Self

Enables HIDE_PERSON_SPRITE macro.

Returns:

Type Description
Self

The updated render options.

show_person_portrait

show_person_portrait() -> Self

Enables SHOW_PERSON_PORTRAIT macro.

Returns:

Type Description
Self

The updated render options.

build

Build and return the final PlantUMLRenderOptions instance.

Returns:

Type Description
PlantUMLRenderOptions

A fully populated PlantUMLRenderOptions instance that can be

PlantUMLRenderOptions

passed to renderers.

c4.renderers.plantuml.options.PlantUMLRenderOptions dataclass

Final render options for rendering a C4-PlantUML diagram.

This class encapsulates all layout directives, macros, tag definitions, and visual styles that should be applied to a diagram at render time.

Attributes:

Name Type Description
includes list[str]

A list of PlantUML !include directives to be injected at the beginning of the diagram.

layout DiagramLayout | None

Layout direction (e.g., top-down, left-right, landscape).

layout_with_legend bool

Whether to apply the LAYOUT_WITH_LEGEND macro.

layout_as_sketch bool

Whether to apply the LAYOUT_AS_SKETCH macro.

set_sketch_style SetSketchStyle | None

Optional sketch-style visual customization.

show_legend ShowLegend | None

Configuration for SHOW_LEGEND macro.

show_floating_legend ShowFloatingLegend | None

Configuration for SHOW_FLOATING_LEGEND macro.

hide_stereotype bool

Whether to hide stereotype labels globally.

hide_person_sprite bool

Whether to hide person sprites globally.

show_person_sprite ShowPersonSprite | None

Configuration for SHOW_PERSON_SPRITE macro.

show_person_portrait bool

Whether to enable person portraits.

show_person_outline bool

Whether to enable person outlines.

without_property_header bool

If no header is used, then the second column is bold.

legend_title str | None

Optional title for the diagram legend.

tags list[BaseTag]

List of tag macros (e.g., AddElementTag, AddRelTag).

styles list[BaseStyle]

List of style update macros (e.g., UpdateElementStyle).

Source code in c4/renderers/plantuml/options.py
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
@dataclass
class PlantUMLRenderOptions:
    """
    Final render options for rendering a C4-PlantUML diagram.

    This class encapsulates all layout directives, macros, tag definitions,
    and visual styles that should be applied to a diagram at render time.

    Attributes:
        includes: A list of PlantUML `!include` directives
            to be injected at the beginning of the diagram.
        layout: Layout direction (e.g., top-down, left-right, landscape).
        layout_with_legend: Whether to apply the LAYOUT_WITH_LEGEND macro.
        layout_as_sketch: Whether to apply the LAYOUT_AS_SKETCH macro.
        set_sketch_style: Optional sketch-style visual customization.
        show_legend: Configuration for SHOW_LEGEND macro.
        show_floating_legend: Configuration for SHOW_FLOATING_LEGEND macro.
        hide_stereotype: Whether to hide stereotype labels globally.
        hide_person_sprite: Whether to hide person sprites globally.
        show_person_sprite: Configuration for SHOW_PERSON_SPRITE macro.
        show_person_portrait: Whether to enable person portraits.
        show_person_outline: Whether to enable person outlines.
        without_property_header: If no header is used, then the second column
            is bold.
        legend_title: Optional title for the diagram legend.
        tags: List of tag macros (e.g., AddElementTag, AddRelTag).
        styles: List of style update macros (e.g., UpdateElementStyle).
    """

    includes: list[str] = field(default_factory=list)
    layout: DiagramLayout | None = None
    layout_with_legend: bool = False
    layout_as_sketch: bool = False
    set_sketch_style: SetSketchStyle | None = None
    show_legend: ShowLegend | None = None
    show_floating_legend: ShowFloatingLegend | None = None
    hide_stereotype: bool = False
    hide_person_sprite: bool = False
    show_person_sprite: ShowPersonSprite | None = None
    show_person_portrait: bool = False
    show_person_outline: bool = False
    without_property_header: bool = False
    legend_title: str | None = None
    tags: list[BaseTag] = field(default_factory=list)
    styles: list[BaseStyle] = field(default_factory=list)

c4.renderers.plantuml.options.DiagramLayout

Defines layout direction options for a PlantUML diagram.

This enum controls how diagram elements are arranged visually using predefined PlantUML layout macros.

Source code in c4/renderers/plantuml/options.py
10
11
12
13
14
15
16
17
18
19
20
21
@unique
class DiagramLayout(StrEnum):
    """
    Defines layout direction options for a PlantUML diagram.

    This enum controls how diagram elements are arranged visually using
    predefined PlantUML layout macros.
    """

    LAYOUT_TOP_DOWN = "LAYOUT_TOP_DOWN"
    LAYOUT_LEFT_RIGHT = "LAYOUT_LEFT_RIGHT"
    LAYOUT_LANDSCAPE = "LAYOUT_LANDSCAPE"

Literal Values

Some builder arguments use literal string values instead of enum classes:

  • TagShape: EightSidedShape, RoundedBoxShape
  • LineStyle: DashedLine, DottedLine, BoldLine, SolidLine
  • Details: Small, Normal, None

Tag Models

c4.renderers.plantuml.options.BaseTag dataclass

Base class for C4-PlantUML tag macros.

Represents shared attributes for tags applied to diagram elements or relationships, including optional visual enhancements and legend metadata.

Attributes:

Name Type Description
tag_stereo str | None

Stereotype name of the tag. Must match one of the tags declared in the tags field of a diagram component.

legend_text str | None

The text shown in the legend for this tag.

legend_sprite str | None

The sprite displayed in the legend.

sprite str | None

The sprite icon associated with the element or relationship.

Source code in c4/renderers/plantuml/options.py
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
@dataclass
class BaseTag:
    """
    Base class for C4-PlantUML tag macros.

    Represents shared attributes for tags applied to diagram elements or
    relationships, including optional visual enhancements and legend metadata.

    Attributes:
        tag_stereo: Stereotype name of the tag. Must match one of the tags
            declared in the `tags` field of a diagram component.
        legend_text: The text shown in the legend for this tag.
        legend_sprite: The sprite displayed in the legend.
        sprite: The sprite icon associated with the element or relationship.
    """

    tag_stereo: str | None = None
    legend_text: str | None = None
    legend_sprite: str | None = None
    sprite: str | None = None

c4.renderers.plantuml.options.ElementTag dataclass

Represents a tag for general diagram elements (e.g., containers, nodes, components).

Defines color, border, shape, and optional technology metadata.

Attributes:

Name Type Description
bg_color str | None

Background color of the element.

font_color str | None

Font color used for labels.

border_color str | None

Color of the element border.

shadowing bool | None

Shadow style or toggle (e.g., "true", "false").

shape TagShape | None

Optional shape used for rendering.

technology str | None

Technology label shown in the element.

border_style LineStyle | None

Border style (e.g., solid, dashed).

border_thickness str | None

Thickness of the borderline.

Source code in c4/renderers/plantuml/options.py
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
@dataclass
class ElementTag(BaseTag):
    """
    Represents a tag for general diagram elements
    (e.g., containers, nodes, components).

    Defines color, border, shape, and optional technology metadata.

    Attributes:
        bg_color: Background color of the element.
        font_color: Font color used for labels.
        border_color: Color of the element border.
        shadowing: Shadow style or toggle (e.g., "true", "false").
        shape: Optional shape used for rendering.
        technology: Technology label shown in the element.
        border_style: Border style (e.g., solid, dashed).
        border_thickness: Thickness of the borderline.
    """

    bg_color: str | None = None
    font_color: str | None = None
    border_color: str | None = None
    shadowing: bool | None = None
    shape: TagShape | None = None
    technology: str | None = None
    border_style: LineStyle | None = None
    border_thickness: str | None = None

c4.renderers.plantuml.options.RelTag dataclass

Represents a tag for relationship styling in the diagram.

Includes text and line formatting, plus optional technology and sprite metadata.

Attributes:

Name Type Description
text_color str | None

Color of the relationship label.

line_color str | None

Color of the relationship line.

line_style LineStyle | None

Line style (e.g., solid, dashed).

line_thickness str | None

Thickness of the line.

technology str | None

Technology label associated with the relationship.

Source code in c4/renderers/plantuml/options.py
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
@dataclass
class RelTag(BaseTag):
    """
    Represents a tag for relationship styling in the diagram.

    Includes text and line formatting, plus optional technology
    and sprite metadata.

    Attributes:
        text_color: Color of the relationship label.
        line_color: Color of the relationship line.
        line_style: Line style (e.g., solid, dashed).
        line_thickness: Thickness of the line.
        technology: Technology label associated with the relationship.
    """

    text_color: str | None = None
    line_color: str | None = None
    line_style: LineStyle | None = None
    line_thickness: str | None = None
    technology: str | None = None

c4.renderers.plantuml.options.BoundaryTag dataclass

Represents a tag for diagram boundaries (e.g., containers or systems).

Defines color, border, shape, and optional type metadata.

Source code in c4/renderers/plantuml/options.py
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
@dataclass
class BoundaryTag(BaseTag):
    """
    Represents a tag for diagram boundaries (e.g., containers or systems).

    Defines color, border, shape, and optional type metadata.
    """

    bg_color: str | None = None
    font_color: str | None = None
    border_color: str | None = None
    shadowing: bool | None = None
    shape: TagShape | None = None
    type_: str | None = None
    border_style: LineStyle | None = None
    border_thickness: str | None = None

c4.renderers.plantuml.options.ComponentTag dataclass

Represents a tag for internal software components.

Inherits common styling options from ElementTag.

Source code in c4/renderers/plantuml/options.py
121
122
123
124
125
126
127
@dataclass
class ComponentTag(ElementTag):
    """
    Represents a tag for internal software components.

    Inherits common styling options from ElementTag.
    """

c4.renderers.plantuml.options.ExternalComponentTag dataclass

Represents a tag for external software components.

Inherits common styling options from ComponentTag.

Source code in c4/renderers/plantuml/options.py
130
131
132
133
134
135
136
@dataclass
class ExternalComponentTag(ComponentTag):
    """
    Represents a tag for external software components.

    Inherits common styling options from ComponentTag.
    """

c4.renderers.plantuml.options.ContainerTag dataclass

Represents a tag for internal containers (e.g., microservices, databases).

Inherits common styling options from ElementTag.

Source code in c4/renderers/plantuml/options.py
139
140
141
142
143
144
145
@dataclass
class ContainerTag(ElementTag):
    """
    Represents a tag for internal containers (e.g., microservices, databases).

    Inherits common styling options from ElementTag.
    """

c4.renderers.plantuml.options.ExternalContainerTag dataclass

Represents a tag for external containers.

Inherits common styling options from ContainerTag.

Source code in c4/renderers/plantuml/options.py
148
149
150
151
152
153
154
@dataclass
class ExternalContainerTag(ContainerTag):
    """
    Represents a tag for external containers.

    Inherits common styling options from ContainerTag.
    """

c4.renderers.plantuml.options.NodeTag dataclass

Represents a tag for nodes, typically infrastructure elements.

Defines color, border, shape, and optional type metadata.

Source code in c4/renderers/plantuml/options.py
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
@dataclass
class NodeTag(BaseTag):
    """
    Represents a tag for nodes, typically infrastructure elements.

    Defines color, border, shape, and optional type metadata.
    """

    bg_color: str | None = None
    font_color: str | None = None
    border_color: str | None = None
    shadowing: bool | None = None
    shape: TagShape | None = None
    type_: str | None = None
    border_style: LineStyle | None = None
    border_thickness: str | None = None

c4.renderers.plantuml.options.PersonTag dataclass

Represents a tag for internal Person elements (actors, users, roles).

Attributes:

Name Type Description
bg_color str | None

Background color of the person symbol.

font_color str | None

Font color used in the label.

border_color str | None

Border color of the symbol.

shadowing bool | None

Whether shadowing is applied.

shape TagShape | None

Optional shape used for rendering.

type_ str | None

Person type (e.g., "person", "group").

border_style LineStyle | None

Border style (e.g., solid, dashed).

border_thickness str | None

Border thickness.

Source code in c4/renderers/plantuml/options.py
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
@dataclass
class PersonTag(BaseTag):
    """
    Represents a tag for internal Person elements (actors, users, roles).

    Attributes:
        bg_color: Background color of the person symbol.
        font_color: Font color used in the label.
        border_color: Border color of the symbol.
        shadowing: Whether shadowing is applied.
        shape: Optional shape used for rendering.
        type_: Person type (e.g., "person", "group").
        border_style: Border style (e.g., solid, dashed).
        border_thickness: Border thickness.
    """

    bg_color: str | None = None
    font_color: str | None = None
    border_color: str | None = None
    shadowing: bool | None = None
    shape: TagShape | None = None
    type_: str | None = None
    border_style: LineStyle | None = None
    border_thickness: str | None = None

c4.renderers.plantuml.options.ExternalPersonTag dataclass

Represents a tag for external people (actors outside the system boundary).

Inherits common styling options from PersonTag.

Source code in c4/renderers/plantuml/options.py
201
202
203
204
205
206
207
@dataclass
class ExternalPersonTag(PersonTag):
    """
    Represents a tag for external people (actors outside the system boundary).

    Inherits common styling options from PersonTag.
    """

c4.renderers.plantuml.options.SystemTag dataclass

Represents a tag for internal software systems.

Attributes:

Name Type Description
bg_color str | None

Background color.

font_color str | None

Font color used in text.

border_color str | None

Color of the system border.

shadowing bool | None

Shadow effect toggle.

shape TagShape | None

Optional rendering shape.

type_ str | None

Type of system (e.g., "software system").

border_style LineStyle | None

Style of the system border line.

border_thickness str | None

Thickness of the border.

Source code in c4/renderers/plantuml/options.py
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
@dataclass
class SystemTag(BaseTag):
    """
    Represents a tag for internal software systems.

    Attributes:
        bg_color: Background color.
        font_color: Font color used in text.
        border_color: Color of the system border.
        shadowing: Shadow effect toggle.
        shape: Optional rendering shape.
        type_: Type of system (e.g., "software system").
        border_style: Style of the system border line.
        border_thickness: Thickness of the border.
    """

    bg_color: str | None = None
    font_color: str | None = None
    border_color: str | None = None
    shadowing: bool | None = None
    shape: TagShape | None = None
    type_: str | None = None
    border_style: LineStyle | None = None
    border_thickness: str | None = None

c4.renderers.plantuml.options.ExternalSystemTag dataclass

Represents a tag for external software systems.

Inherits common styling options from SystemTag.

Source code in c4/renderers/plantuml/options.py
236
237
238
239
240
241
242
@dataclass
class ExternalSystemTag(SystemTag):
    """
    Represents a tag for external software systems.

    Inherits common styling options from SystemTag.
    """

Style Models

c4.renderers.plantuml.options.ElementStyle dataclass

Defines style overrides for an individual diagram element.

Attributes:

Name Type Description
element_name str | None

Alias of the element to style.

bg_color str | None

Background color.

font_color str | None

Font/text color.

border_color str | None

Borderline color.

shadowing bool | None

Shadow effect toggle.

shape TagShape | None

Shape type used for rendering.

sprite str | None

Optional sprite icon.

technology str | None

Optional technology label.

legend_text str | None

Label used in the legend.

legend_sprite str | None

Sprite shown in the legend.

border_style LineStyle | None

Borderline style (e.g. dashed, solid).

border_thickness str | None

Thickness of the borderline.

Source code in c4/renderers/plantuml/options.py
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
@dataclass
class ElementStyle(BaseStyle):
    """
    Defines style overrides for an individual diagram element.

    Attributes:
        element_name: Alias of the element to style.
        bg_color: Background color.
        font_color: Font/text color.
        border_color: Borderline color.
        shadowing: Shadow effect toggle.
        shape: Shape type used for rendering.
        sprite: Optional sprite icon.
        technology: Optional technology label.
        legend_text: Label used in the legend.
        legend_sprite: Sprite shown in the legend.
        border_style: Borderline style (e.g. dashed, solid).
        border_thickness: Thickness of the borderline.
    """

    element_name: str | None = None
    bg_color: str | None = None
    font_color: str | None = None
    border_color: str | None = None
    shadowing: bool | None = None
    shape: TagShape | None = None
    sprite: str | None = None
    technology: str | None = None
    legend_text: str | None = None
    legend_sprite: str | None = None
    border_style: LineStyle | None = None
    border_thickness: str | None = None

c4.renderers.plantuml.options.RelStyle dataclass

Defines style overrides for relationship lines.

Attributes:

Name Type Description
text_color str | None

Color of the relationship label.

line_color str | None

Color of the connecting line.

Source code in c4/renderers/plantuml/options.py
289
290
291
292
293
294
295
296
297
298
299
300
@dataclass
class RelStyle(BaseStyle):
    """
    Defines style overrides for relationship lines.

    Attributes:
        text_color: Color of the relationship label.
        line_color: Color of the connecting line.
    """

    text_color: str | None = None
    line_color: str | None = None

c4.renderers.plantuml.options.BoundaryStyle dataclass

Defines style overrides for a boundary element (e.g. container, system).

Attributes:

Name Type Description
type_ str | None

The type of boundary (e.g., "System", "Container").

Source code in c4/renderers/plantuml/options.py
303
304
305
306
307
308
309
310
311
312
@dataclass
class BoundaryStyle(ElementStyle):
    """
    Defines style overrides for a boundary element (e.g. container, system).

    Attributes:
        type_: The type of boundary (e.g., "System", "Container").
    """

    type_: str | None = None

c4.renderers.plantuml.options.ContainerBoundaryStyle dataclass

Defines style overrides for container boundaries.

Inherits common styling options from BoundaryStyle.

Source code in c4/renderers/plantuml/options.py
315
316
317
318
319
320
321
@dataclass
class ContainerBoundaryStyle(BoundaryStyle):
    """
    Defines style overrides for container boundaries.

    Inherits common styling options from BoundaryStyle.
    """

c4.renderers.plantuml.options.SystemBoundaryStyle dataclass

Defines style overrides for system boundaries.

Inherits common styling options from BoundaryStyle.

Source code in c4/renderers/plantuml/options.py
324
325
326
327
328
329
330
@dataclass
class SystemBoundaryStyle(BoundaryStyle):
    """
    Defines style overrides for system boundaries.

    Inherits common styling options from BoundaryStyle.
    """

c4.renderers.plantuml.options.EnterpriseBoundaryStyle dataclass

Defines style overrides for enterprise boundaries.

Inherits common styling options from BoundaryStyle.

Source code in c4/renderers/plantuml/options.py
333
334
335
336
337
338
339
@dataclass
class EnterpriseBoundaryStyle(BoundaryStyle):
    """
    Defines style overrides for enterprise boundaries.

    Inherits common styling options from BoundaryStyle.
    """

Layout Option Models

c4.renderers.plantuml.options.ShowLegend dataclass

Configuration for the SHOW_LEGEND macro in PlantUML.

Controls the visibility and detail level of the diagram legend, which explains the meaning of applied tags and stereotypes.

Attributes:

Name Type Description
hide_stereotype bool | None

Whether to hide stereotype labels in the legend.

details Details | None

Level of detail to display ("Small", "Normal", or "None").

Source code in c4/renderers/plantuml/options.py
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
@dataclass
class ShowLegend:
    """
    Configuration for the SHOW_LEGEND macro in PlantUML.

    Controls the visibility and detail level of the diagram legend,
    which explains the meaning of applied tags and stereotypes.

    Attributes:
        hide_stereotype: Whether to hide stereotype labels in the legend.
        details: Level of detail to display ("Small", "Normal", or "None").
    """

    hide_stereotype: bool | None = None
    details: Details | None = None

c4.renderers.plantuml.options.ShowFloatingLegend dataclass

Configuration for the SHOW_FLOATING_LEGEND macro.

Similar to ShowLegend but renders the legend in a floating box that can be referenced and positioned using an alias.

Attributes:

Name Type Description
alias str | None

Optional alias name for the floating legend box.

Source code in c4/renderers/plantuml/options.py
359
360
361
362
363
364
365
366
367
368
369
370
371
@dataclass
class ShowFloatingLegend(ShowLegend):
    """
    Configuration for the SHOW_FLOATING_LEGEND macro.

    Similar to ShowLegend but renders the legend in a floating box
    that can be referenced and positioned using an alias.

    Attributes:
        alias: Optional alias name for the floating legend box.
    """

    alias: str | None = None

c4.renderers.plantuml.options.ShowPersonSprite dataclass

Configuration for the SHOW_PERSON_SPRITE macro.

Displays a visual sprite next to person elements using a given alias.

Attributes:

Name Type Description
alias str | None

Optional sprite alias to use for the person icon.

Source code in c4/renderers/plantuml/options.py
374
375
376
377
378
379
380
381
382
383
384
385
@dataclass
class ShowPersonSprite:
    """
    Configuration for the SHOW_PERSON_SPRITE macro.

    Displays a visual sprite next to person elements using a given alias.

    Attributes:
        alias: Optional sprite alias to use for the person icon.
    """

    alias: str | None = None

c4.renderers.plantuml.options.SetSketchStyle dataclass

Configuration for the SET_SKETCH_STYLE macro.

Applies global sketch-style theming to the diagram, mimicking a hand-drawn appearance.

Attributes:

Name Type Description
bg_color str | None

Background color of the diagram.

font_color str | None

Font color for all text.

warning_color str | None

Color used for warning messages in the footer.

font_name str | None

Font family name to use.

footer_warning str | None

Optional warning message shown in the footer.

footer_text str | None

Optional text message shown in the footer.

Source code in c4/renderers/plantuml/options.py
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
@dataclass
class SetSketchStyle:
    """
    Configuration for the SET_SKETCH_STYLE macro.

    Applies global sketch-style theming to the diagram, mimicking
    a hand-drawn appearance.

    Attributes:
        bg_color: Background color of the diagram.
        font_color: Font color for all text.
        warning_color: Color used for warning messages in the footer.
        font_name: Font family name to use.
        footer_warning: Optional warning message shown in the footer.
        footer_text: Optional text message shown in the footer.
    """

    bg_color: str | None = None
    font_color: str | None = None
    warning_color: str | None = None
    font_name: str | None = None
    footer_warning: str | None = None
    footer_text: str | None = None