home-assistant / frontend

:lollipop: Frontend for Home Assistant
https://demo.home-assistant.io
Other
4.01k stars 2.74k forks source link

Vertical/Horizontal stack combined #7080

Closed giuliandenicola1 closed 3 years ago

giuliandenicola1 commented 4 years ago

The request

I would like to have the stack cards combined. So how this would work is it's a horizontal stack by default, but you set up the max amount of stacks it can take so that if that's reached it will become a vertical stack so it would start under again as a horizontal stack.

For example instead of having this code:

type: vertical-stack
cards:
- type: horizontal-stack
  cards:
    - type: button
      name: button 1 
    - type: button
      name: button 2
- type: horizontal-stack
  cards:
    - type: button
      name: button 3
    - type: button
      name: button 4

You will have this code:

type: combined-stack
max_columns: 2
cards:
  - type: button
    name: button 1 
  - type: button
    name: button 2
  - type: button
    name: button 3
  - type: button
    name: button 4

The alternatives

I'm using the custom card layout-card right now, it can set max_columns and has the same effect.

Additional information

EDIT Is this also core?

zsarnett commented 4 years ago

I dont think this is something we should add. Especially with the new Custom Views. Someone can create a custom view and allow users to do this with the layout property on all cards

iantrich commented 3 years ago

About as close as we'll get in core: https://github.com/home-assistant/frontend/pull/7476