Visibility¶
Visibility controls whether an item is shown, hidden, or unavailable. It can be fixed in the configuration or changed from an entity state, which makes it possible to reveal information only when it is relevant.
This page shows how to hide an item, change visibility from a state, make a control visibly unavailable, remove a configured item with disabled, and show or hide a complete group together.
Visibility values¶
Normal layout items use two fixed visibility values. The default is visible:
visible— the item is shown.hidden— the item is not shown.
Controls also accept unavailable. It keeps the control visible with its unavailable appearance instead of making it usable.
A JavaScript template can return the same values when visibility should depend on card data.
Hide an item¶
A fixed visibility value can hide an item without removing its configuration:
Show an item only for a matching state¶
This Rectangle is shown only while the selected entity reports heating:
Keep a control visible but unavailable¶
Use visibility: unavailable when a control should remain visible but must not accept input. The control uses its unavailable appearance and its tap, hold, and double-tap actions are blocked. A JavaScript template can return unavailable when this should follow the current state.
Remove an item from the configured card¶
Use disabled: true when an entity or layout item should not be included in the configured card at all. This is different from visibility: hidden: a hidden item still exists but is not shown, while a disabled item is left out when the card configuration is built.
disabled accepts true/false, 1/0, and equivalent values produced by supported configuration expressions. It is a configuration-time choice; use visibility when showing or hiding an existing item should change while the card is running.
Show or hide a complete group¶
Put related items in a group when they should appear and disappear together: