Dynamic dashboard with conditional's cards

Good morning everyone!
I have a small 7 inch display showing the HomeAssistant dashboard.
I have many cards that turn on or off depending on certain conditions.
My dream, using custom components of course, would be for it to take on this behavior:

1 card: full screen (100%, 100%)
2 cards: one under the other (100%, 50%)
3 cards: one below the other and the third to the right (50% 50% 100%)
4 cards: 2 below 2 (50% 50% 50% 50%)

In short, a dynamic layout change depending on the cards present.
I wanted to ask, what is the best method/strategy to do this?
Thank you!

You might take a look at layout-card:

I don’t know that it will do what you want, but in scrolling through the readme, it might.

Thanks.

With this custom component I can make the view, yes, but the problem is that it stays that way once it is configured.

I can set a grid (3x3 for example) but I can’t say that when I have only one card it must be a 1x1 full screen.

Maybe I am doing it wrong?

Probably not. It was a bit of a stretch to think that mod would help. It probably would require the mod itself to be able to do more advanced conditionals than it has. It was worth a shot though. The really horrible way to try and do it would be to have a bunch of conditional cards that inside them had various vertical and horizontal stacks based on the number of active things, but you’d end up repeating every card for every possible layout. The more I think about it the less I like that idea.

1 Like