hd-section
on changeA part of the widget that folds open and closed under a heading, like the sections of the widget settings; while closed it shows summary. To remember it per screen, bind open to the widget’s state and keep each change: open="{{ state.schedule }}" data-hd-on-change="setState('schedule', event.value)". Without that it still folds, but starts over when the widget is drawn anew.
| Attribute | What it is |
|---|---|
headingrequired | What the section is called. |
icon | Semantic icon before the heading. |
summary | A short line beside the heading while closed, e.g. “Next: 21° at 17:00”. |
open | true (open) or false (closed); empty leaves it to start. Bind it to state to remember it. |
start | How it starts while open is empty, so before anything is remembered.One of closed, open. Default closed. |
variant | A heading over a hairline, or a raised card.One of plain, card. Default plain. |
<hd-section heading="Details" open="{{ state.details }}" data-hd-on-change="setState('details', event.value)"> <p>{{ device.name }}</p></hd-section>