Hello Home Assistant developers,
I’m a Home Assistant user who has been working extensively with Lovelace UI. One persistent issue I have encountered is the inability of the default Grid Card to dynamically adjust the number of columns based on screen width.
Problem:
- Currently, the
grid
card requires a fixedcolumns
value, which does not allow responsiveness. - Using
layout-card
is an alternative, but it introduces unwanted spacing around elements likecustom:button-card
, making it unsuitable for precise UI design. card-mod
does not provide an effective way to change the column count dynamically either.
Proposed Solution:
- Introduce native support in the
grid
card for dynamic columns usinggrid-template-columns: repeat(auto-fit, minmax(Xpx, 1fr))
. - Allow media queries in the
grid
card configuration to adjust the column count based on screen size.
Use Case:
For example, I would like to have:
- 3 columns on desktop (width > 1000px)
- 2 columns on tablets (width between 767px - 999px)
- 1 column on mobile devices (width < 767px)
Currently, this is impossible without using third-party workarounds that break the design consistency.
Expected Benefit:
- A more flexible and responsive UI in Home Assistant without requiring custom cards.
- Improved native handling of different screen sizes within Lovelace.
- Reduced reliance on third-party solutions for fundamental UI needs.
I appreciate all the hard work the developers put into Home Assistant, and I believe this feature would greatly enhance the Lovelace experience for many users.
Looking forward to your thoughts and feedback.
Thanks!