Icon¶
An icon gives an entity a recognizable visual place on the card. Use it to show an entity icon, a custom MDI icon, or an image anywhere in the layout.
Flexible Horseshoe Card can use a Home Assistant entity icon, a configured MDI icon, or an SVG, PNG, JPG, or other supported image.
Basic configuration¶
Add icons under layout.icons:
Without an explicit icon, Flexible Horseshoe Card uses the icon of the selected Home Assistant entity.
Configuration options¶
| Field | Required | Default | Description |
|---|---|---|---|
xpos | Yes | Horizontal icon position | |
ypos | Yes | Vertical icon position | |
entity_index | No | Not set | Entity whose icon and state can be used |
icon | No | Entity icon | MDI icon or url(...) SVG/image |
icon_size | No | Relative icon size | |
icon_size_percent | No | Not set | Icon size relative to the card |
align | No | center | start, center, or end |
rotate | No | 0 | Icon rotation in degrees |
state_map | No | Not set | Selects an icon based on entity state |
styles | No | Default icon style | SVG and CSS styling |
color_stops | No | Not set | Colors the icon from the entity state |
Choose the icon¶
Set icon when you want to use a specific icon instead of the Home Assistant entity icon:
You can also configure an icon on the entity:
An icon configured directly on the Icon tool takes priority over the entity icon.
SVG and image files¶
Use url(...) to display an SVG or image instead of an MDI icon.
The URL can also point to an external image:
This makes the Icon tool useful for both Home Assistant icons and custom graphics.
Size and position¶
Position an icon with xpos and ypos.
Use icon_size for the regular relative icon size:
Use icon_size_percent when the icon should scale relative to the card:
See Positioning and sizing for more about the card coordinate system.
Alignment¶
Use align to control how the icon is positioned around xpos:
Rotate an icon¶
Use rotate to rotate the icon:
Change the icon by state¶
Use state_map when different entity states should display different icons:
A default entry can provide a fallback when no other state matches:
Icon appearance¶
Use styles to change the appearance of an icon:
See Styling for the complete styling guide.
Color from an entity¶
When an icon is connected to an entity, color stops can change its color from the entity state:
See Color stops for ranges, gradients, palettes, and interpolation.