Reuse keeps repeated card YAML in one place. It can copy one layout item, repeat a visual arrangement, reuse a shared value or style, or reuse an entire card design depending on how much of the configuration is the same.
This page starts from what you want to repeat and shows which reuse method fits that job.
layout:rectangles:-id:panel# Name this item so it can be referenced laterxpos:25# Horizontal position; 50 = center of the cardypos:50# Vertical position; 50 = center of the cardwidth:35# Width in card coordinatesheight:30# Height in card coordinatesradius:4# Radius of this shapestyles:fill:none# Keep the inside transparent; draw only the borderstroke:var(--divider-color)# Border or line color-same_as:panel# Start with the settings from panelxpos:75# Horizontal position; 50 = center of the card
The second Rectangle keeps the first Rectangle's settings and changes only its position.
constants:dividerStyle:stroke:var(--divider-color)# Border or line colorstroke-width:2# Border or line thicknesslayout:lines:-orientation:horizontal# Arrange it from left to rightxpos:50# Horizontal position; 50 = center of the cardypos:40# Vertical position; 50 = center of the cardlength:80# Length of the linestyles:ref(dividerStyle)
entities:-entity:sensor.example_1# Entity used by this example-entity:sensor.example_2# Entity used by this exampleconstants:centerX:50gap:12# Space between these visible partslayout:states:-entity_index:0# Use entity 0 from entities: (0 = first entity)xpos:calc(centerX - gap)# Horizontal position; 50 = center of the cardypos:50# Vertical position; 50 = center of the card-entity_index:1# Use entity 1 from entities: (0 = first entity)xpos:calc(centerX + gap)# Horizontal position; 50 = center of the cardypos:50# Vertical position; 50 = center of the card