Header one color, body different color

0 votes
asked Dec 4, 2025 in Question / help by anonymous
If I have a component such as

component NAME [
title
--
text
]

is there no way to have title be one background color, and text another background color?
It doesn't have to be a component either, anything that can be rendered as a rectangle parted in two by a horizontal line, with text above and below it, is good for me

2 Answers

0 votes
answered Dec 5, 2025 by The-Lu (86,860 points)
selected Dec 5, 2025 by Serge Wenger Work
 
Best answer

Hello A.,

To complete the Serge's answer, you can also use "object", "map" or "json".

See examples here:

Enjoy,
Regards,
Th.

0 votes
answered Dec 4, 2025 by Serge Wenger Work (16,630 points)

Hello,

This can be done with class:

@startuml
class Demo1 #back:lightgreen;header:blue {
  text with spaces
}
hide empty methods
hide circle
@enduml

commented Dec 4, 2025 by anonymous
thank you :)
...