Skip to content

Layout options

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

c4.renderers.plantuml.layout_options.LayoutOptions

Builder class for generating PlantUML layout configuration macros and tags.

Supports defining layout direction (e.g., top-down, left-right, landscape), toggling macros like sketch mode and legend display, and applying custom tag and style macros for diagram elements (e.g., components, systems, people, containers).

add_element_tag

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

Adds an AddElementTag() macro configuration.

Parameters:

Name Type Description Default
tag_stereo str

The tag stereotype name.

required
bg_color str

Background color.

''
font_color str

Font color.

''
border_color str

Border color.

''
shadowing str

Shadow effect setting.

''
shape TagShape

Optional shape modifier.

''
sprite str

Optional sprite reference.

''
technology str

Technology metadata.

''
legend_text str

Legend label.

''
legend_sprite str

Legend sprite.

''
border_style LineStyle

Border style.

''
border_thickness str

Border thickness.

''

Returns:

Type Description
Self

The updated layout configuration.

add_boundary_tag

add_boundary_tag(
    tag_stereo: str,
    bg_color: str = "",
    font_color: str = "",
    border_color: str = "",
    shadowing: str = "",
    shape: TagShape = "",
    sprite: str = "",
    technology: str = "",
    legend_text: str = "",
    legend_sprite: str = "",
    border_style: LineStyle = "",
    border_thickness: str = "",
) -> Self

Adds an AddBoundaryTag() macro configuration.

Parameters:

Name Type Description Default
tag_stereo str

The tag stereotype name.

required
bg_color str

Background color.

''
font_color str

Font color.

''
border_color str

Border color.

''
shadowing str

Shadow effect setting.

''
shape TagShape

Optional shape modifier.

''
sprite str

Optional sprite reference.

''
technology str

Technology metadata.

''
legend_text str

Legend label.

''
legend_sprite str

Legend sprite.

''
border_style LineStyle

Border style.

''
border_thickness str

Border thickness.

''

Returns:

Type Description
Self

The updated layout configuration.

add_rel_tag

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

Adds an AddRelTag() macro configuration.

Parameters:

Name Type Description Default
tag_stereo str

The tag stereotype name.

required
text_color str

Text color.

''
line_color str

Line color.

''
sprite str

Optional sprite reference.

''
technology str

Technology metadata.

''
legend_text str

Legend label.

''
legend_sprite str

Legend sprite.

''
line_style LineStyle

Line style.

''
line_thickness str

Line thickness.

''

Returns:

Type Description
Self

The updated layout configuration.

add_component_tag

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

Adds an AddComponentTag() macro configuration.

Parameters:

Name Type Description Default
tag_stereo str

The tag stereotype name.

required
bg_color str

Background color.

''
font_color str

Font color.

''
border_color str

Border color.

''
shadowing str

Shadow effect setting.

''
shape TagShape

Optional shape modifier.

''
sprite str

Optional sprite reference.

''
technology str

Technology metadata.

''
legend_text str

Legend label.

''
legend_sprite str

Legend sprite.

''
border_style LineStyle

Border style.

''
border_thickness str

Border thickness.

''

Returns:

Type Description
Self

The updated layout configuration.

add_external_component_tag

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

Adds an AddExternalComponentTag() macro configuration.

Parameters:

Name Type Description Default
tag_stereo str

The tag stereotype name.

required
bg_color str

Background color.

''
font_color str

Font color.

''
border_color str

Border color.

''
shadowing str

Shadow effect setting.

''
shape TagShape

Optional shape modifier.

''
sprite str

Optional sprite reference.

''
technology str

Technology metadata.

''
legend_text str

Legend label.

''
legend_sprite str

Legend sprite.

''
border_style LineStyle

Border style.

''
border_thickness str

Border thickness.

''

Returns:

Type Description
Self

The updated layout configuration.

add_container_tag

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

Adds an AddContainerTag() macro configuration.

Parameters:

Name Type Description Default
tag_stereo str

The tag stereotype name.

required
bg_color str

Background color.

''
font_color str

Font color.

''
border_color str

Border color.

''
shadowing str

Shadow effect setting.

''
shape TagShape

Optional shape modifier.

''
sprite str

Optional sprite reference.

''
technology str

Technology metadata.

''
legend_text str

Legend label.

''
legend_sprite str

Legend sprite.

''
border_style LineStyle

Border style.

''
border_thickness str

Border thickness.

''

Returns:

Type Description
Self

The updated layout configuration.

add_external_container_tag

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

Adds an AddExternalContainerTag() macro configuration.

Parameters:

Name Type Description Default
tag_stereo str

The tag stereotype name.

required
bg_color str

Background color.

''
font_color str

Font color.

''
border_color str

Border color.

''
shadowing str

Shadow effect setting.

''
shape TagShape

Optional shape modifier.

''
sprite str

Optional sprite reference.

''
technology str

Technology metadata.

''
legend_text str

Legend label.

''
legend_sprite str

Legend sprite.

''
border_style LineStyle

Border style.

''
border_thickness str

Border thickness.

''

Returns:

Type Description
Self

The updated layout configuration.

add_node_tag

add_node_tag(
    tag_stereo: str,
    bg_color: str = "",
    font_color: str = "",
    border_color: str = "",
    shadowing: str = "",
    shape: TagShape = "",
    sprite: str = "",
    technology: str = "",
    legend_text: str = "",
    legend_sprite: str = "",
    border_style: LineStyle = "",
    border_thickness: str = "",
) -> Self

Adds an AddNodeTag() macro configuration.

Parameters:

Name Type Description Default
tag_stereo str

The tag stereotype name.

required
bg_color str

Background color.

''
font_color str

Font color.

''
border_color str

Border color.

''
shadowing str

Shadow effect setting.

''
shape TagShape

Optional shape modifier.

''
sprite str

Optional sprite reference.

''
technology str

Technology metadata.

''
legend_text str

Legend label.

''
legend_sprite str

Legend sprite.

''
border_style LineStyle

Border style.

''
border_thickness str

Border thickness.

''

Returns:

Type Description
Self

The updated layout configuration.

add_person_tag

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

Adds an AddPersonTag() macro configuration.

Parameters:

Name Type Description Default
tag_stereo str

The tag stereotype name.

required
bg_color str

Background color.

''
font_color str

Font color.

''
border_color str

Border color.

''
shadowing str

Shadow effect setting.

''
shape TagShape

Optional shape modifier.

''
sprite str

Optional sprite reference.

''
type_ str

Person type.

''
legend_text str

Legend label.

''
legend_sprite str

Legend sprite.

''
border_style LineStyle

Border style.

''
border_thickness str

Border thickness.

''

Returns:

Type Description
Self

The updated layout configuration.

add_external_person_tag

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

Adds an AddExternalPersonTag() macro configuration.

Parameters:

Name Type Description Default
tag_stereo str

The tag stereotype name.

required
bg_color str

Background color.

''
font_color str

Font color.

''
border_color str

Border color.

''
shadowing str

Shadow effect setting.

''
shape TagShape

Optional shape modifier.

''
sprite str

Optional sprite reference.

''
type_ str

Person type.

''
legend_text str

Legend label.

''
legend_sprite str

Legend sprite.

''
border_style LineStyle

Border style.

''
border_thickness str

Border thickness.

''

Returns:

Type Description
Self

The updated layout configuration.

add_system_tag

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

Adds an AddSystemTag() macro configuration.

Parameters:

Name Type Description Default
tag_stereo str

The tag stereotype name.

required
bg_color str

Background color.

''
font_color str

Font color.

''
border_color str

Border color.

''
shadowing str

Shadow effect setting.

''
shape TagShape

Optional shape modifier.

''
sprite str

Optional sprite reference.

''
type_ str

System type.

''
legend_text str

Legend label.

''
legend_sprite str

Legend sprite.

''
border_style LineStyle

Border style.

''
border_thickness str

Border thickness.

''

Returns:

Type Description
Self

The updated layout configuration.

add_external_system_tag

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

Adds an AddExternalSystemTag() macro configuration.

Parameters:

Name Type Description Default
tag_stereo str

The tag stereotype name.

required
bg_color str

Background color.

''
font_color str

Font color.

''
border_color str

Border color.

''
shadowing str

Shadow effect setting.

''
shape TagShape

Optional shape modifier.

''
sprite str

Optional sprite reference.

''
type_ str

System type.

''
legend_text str

Legend label.

''
legend_sprite str

Legend sprite.

''
border_style LineStyle

Border style.

''
border_thickness str

Border thickness.

''

Returns:

Type Description
Self

The updated layout configuration.

update_element_style

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

Adds an UpdateElementStyle() macro configuration.

Parameters:

Name Type Description Default
element_name str

Element name.

required
bg_color str

Background color.

''
font_color str

Font color.

''
border_color str

Border color.

''
shadowing str

Shadow effect setting.

''
shape TagShape

Optional shape modifier.

''
sprite str

Optional sprite reference.

''
technology str

Technology metadata.

''
legend_text str

Legend label.

''
legend_sprite str

Legend sprite.

''
border_style LineStyle

Border style.

''
border_thickness str

Border thickness.

''

Returns:

Type Description
Self

The updated layout configuration.

update_boundary_style

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

Adds an UpdateBoundaryStyle() macro configuration.

Parameters:

Name Type Description Default
element_name str

Element name.

required
bg_color str

Background color.

''
font_color str

Font color.

''
border_color str

Border color.

''
shadowing str

Shadow effect setting.

''
shape TagShape

Optional shape modifier.

''
type_ str

Element type.

''
sprite str

Optional sprite reference.

''
technology str

Technology metadata.

''
legend_text str

Legend label.

''
legend_sprite str

Legend sprite.

''
border_style LineStyle

Border style.

''
border_thickness str

Border thickness.

''

Returns:

Type Description
Self

The updated layout configuration.

update_rel_style

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

Adds an UpdateRelStyle() macro configuration.

Parameters:

Name Type Description Default
text_color str

Text color.

''
line_color str

Line color.

''

Returns:

Type Description
Self

The updated layout configuration.

update_container_boundary_style

update_container_boundary_style(
    element_name: str,
    bg_color: str = "",
    font_color: str = "",
    border_color: str = "",
    shadowing: str = "",
    shape: TagShape = "",
    type_: str = "",
    sprite: str = "",
    technology: str = "",
    legend_text: str = "",
    legend_sprite: str = "",
    border_style: LineStyle = "",
    border_thickness: str = "",
) -> Self

Adds an UpdateContainerBoundaryStyle() macro configuration.

Parameters:

Name Type Description Default
element_name str

Element name.

required
bg_color str

Background color.

''
font_color str

Font color.

''
border_color str

Border color.

''
shadowing str

Shadow effect setting.

''
shape TagShape

Optional shape modifier.

''
type_ str

Element type.

''
sprite str

Optional sprite reference.

''
technology str

Technology metadata.

''
legend_text str

Legend label.

''
legend_sprite str

Legend sprite.

''
border_style LineStyle

Border style.

''
border_thickness str

Border thickness.

''

Returns:

Type Description
Self

The updated layout configuration.

update_system_boundary_style

update_system_boundary_style(
    element_name: str,
    bg_color: str = "",
    font_color: str = "",
    border_color: str = "",
    shadowing: str = "",
    shape: TagShape = "",
    type_: str = "",
    sprite: str = "",
    technology: str = "",
    legend_text: str = "",
    legend_sprite: str = "",
    border_style: LineStyle = "",
    border_thickness: str = "",
) -> Self

Adds an UpdateSystemBoundaryStyle() macro configuration.

Parameters:

Name Type Description Default
element_name str

Element name.

required
bg_color str

Background color.

''
font_color str

Font color.

''
border_color str

Border color.

''
shadowing str

Shadow effect setting.

''
shape TagShape

Optional shape modifier.

''
type_ str

Container type.

''
sprite str

Optional sprite reference.

''
technology str

Technology metadata.

''
legend_text str

Legend label.

''
legend_sprite str

Legend sprite.

''
border_style LineStyle

Border style.

''
border_thickness str

Border thickness.

''

Returns:

Type Description
Self

The updated layout configuration.

update_enterprise_boundary_style

update_enterprise_boundary_style(
    element_name: str,
    bg_color: str = "",
    font_color: str = "",
    border_color: str = "",
    shadowing: str = "",
    shape: TagShape = "",
    type_: str = "",
    sprite: str = "",
    technology: str = "",
    legend_text: str = "",
    legend_sprite: str = "",
    border_style: LineStyle = "",
    border_thickness: str = "",
) -> Self

Adds an UpdateEnterpriseBoundaryStyle() macro configuration.

Parameters:

Name Type Description Default
element_name str

Element name.

required
bg_color str

Background color.

''
font_color str

Font color.

''
border_color str

Border color.

''
shadowing str

Shadow effect setting.

''
shape TagShape

Optional shape modifier.

''
type_ str

Container type.

''
sprite str

Optional sprite reference.

''
technology str

Technology metadata.

''
legend_text str

Legend label.

''
legend_sprite str

Legend sprite.

''
border_style LineStyle

Border style.

''
border_thickness str

Border thickness.

''

Returns:

Type Description
Self

The updated layout configuration.

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 layout configuration.

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 layout configuration.

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 layout configuration.

layout_with_legend

layout_with_legend() -> Self

Enables LAYOUT_WITH_LEGEND macro.

Returns:

Type Description
Self

The updated layout configuration.

layout_as_sketch

layout_as_sketch() -> Self

Enables LAYOUT_AS_SKETCH macro.

Returns:

Type Description
Self

The updated layout configuration.

without_property_header

without_property_header() -> Self

Enables WithoutPropertyHeader macro.

Returns:

Type Description
Self

The updated layout configuration.

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 layout configuration.

show_legend

show_legend(
    hide_stereotype: bool = True,
    details: Literal["Small", "Normal", "None"] = "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 Literal['Small', 'Normal', 'None']

Level of detail to show.

'Small'

Returns:

Type Description
Self

The updated layout configuration.

show_floating_legend

show_floating_legend(
    alias: str | None = None,
    hide_stereotype: bool = True,
    details: Literal["Small", "Normal", "None"] = "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 Literal['Small', 'Normal', 'None']

Level of detail to show.

'Small'

Returns:

Type Description
Self

The updated layout configuration.

update_legend_title

update_legend_title(new_title: str) -> Self

Sets a custom title for the legend.

Parameters:

Name Type Description Default
new_title str

The title to display above the legend.

required

Returns:

Type Description
Self

The updated layout configuration.

show_person_outline

show_person_outline() -> Self

Enables SHOW_PERSON_OUTLINE macro.

Returns:

Type Description
Self

The updated layout configuration.

show_element_descriptions

show_element_descriptions() -> Self

Enables SHOW_ELEMENT_DESCRIPTIONS macro.

Returns:

Type Description
Self

The updated layout configuration.

show_foot_boxes

show_foot_boxes() -> Self

Enables SHOW_FOOT_BOXES macro.

Returns:

Type Description
Self

The updated layout configuration.

show_index

show_index() -> Self

Enables SHOW_INDEX macro.

Returns:

Type Description
Self

The updated layout configuration.

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 layout configuration.

hide_stereotype

hide_stereotype() -> Self

Enables HIDE_STEREOTYPE macro.

Returns:

Type Description
Self

The updated layout configuration.

hide_person_sprite

hide_person_sprite() -> Self

Enables HIDE_PERSON_SPRITE macro.

Returns:

Type Description
Self

The updated layout configuration.

show_person_portrait

show_person_portrait() -> Self

Enables SHOW_PERSON_PORTRAIT macro.

Returns:

Type Description
Self

The updated layout configuration.