Hello HA community! Here’s a custom card I made after posting in the Discord and finding no card that fit my needs. It makes cards appear as either a horizontal-stack
or vertical-stack
, depending on your screen’s width. Works best if you use it with vertical-stack
nested underneath, for example all of your lights in a vertical-stack
or each room in their own vertical-stack
.
Installation
Install threshold-stack.js
as a module
.
resources:
- url: /local/threshold-stack.js
type: module
Usage
type: custom:threshold-stack
threshold: <pixels>px
cards:
...
If the device is at least pixels
pixels wide, cards
will be displayed as a horizontal-stack
.
If the device is less than pixels
pixels wide, cards
will be displayed as a vertical-stack
.
Options
-
threshold
Threshold in pixels forhorizontal-stack
. Default:800px
-
cards
Required Cards to render; works particularly well as avertical-stack
container