Components
Icon tile
An icon on a tinted rounded square.
Sizes and colors#
<span class="ha-icon-tile ha-icon-tile--sm"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M13 2 4 14h7l-1 8 9-12h-7l1-8z"/></svg></span>
<span class="ha-icon-tile"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M12 3a9 9 0 1 0 0 18c1.4 0 2-1 1.6-2.1-.4-1 .2-2.1 1.4-2.100H17a4 4 0 0 0 4-4C21 6.7 17 3 12 3z"/><circle cx="7.5" cy="11" r="1"/><circle cx="10" cy="7.5" r="1"/><circle cx="14.5" cy="7.5" r="1"/></svg></span>
<span class="ha-icon-tile ha-icon-tile--lg" style="--ha-cor:#14b8a6"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="m12 3 9 5-9 5-9-5 9-5z"/><path d="m3 13 9 5 9-5"/></svg></span>
<span class="ha-icon-tile" style="--ha-cor:#8b5cf6"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M2 12s3.5-7 10-7 10 7 10 7-3.5 7-10 7S2 12 2 12z"/><circle cx="12" cy="12" r="3"/></svg></span>
<span class="ha-icon-tile" style="--ha-cor:#a8e05f"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="m2 9 10-5 10 5-10 5L2 9z"/><path d="M6 11.500V16c0 1.5 2.7 3 6 3s6-1.5 6-3v-4.5"/></svg></span>The tint mixes 16% of --ha-cor into surface-2. The icon takes the text color, so it keeps contrast on any tint.
| Class | Purpose |
|---|---|
ha-icon-tile, --sm, --lg | 40, 52, and 64px tiles. |
--ha-cor | The tint color. |
Accessibility#
- Decorative icons need
aria-hidden="true". If the tile carries meaning alone, give it a text alternative.