You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+74-4Lines changed: 74 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -120,8 +120,39 @@ Example title card that is clickable and has 2 nested cards, which is directly e
120
120
name: null
121
121
show_wind: speed
122
122
```
123
+
### Heading Title card
123
124
124
-
### Title
125
+
Example with [heading](https://www.home-assistant.io/dashboards/heading/) title card to the possiblity to style your title.
126
+
127
+
```yaml
128
+
- type: custom:expander-card
129
+
title-card:
130
+
type: heading
131
+
heading: Title
132
+
heading_style: title
133
+
badges:
134
+
- type: entity
135
+
show_name: false
136
+
show_state: true
137
+
show_icon: true
138
+
entity: light.bed_light
139
+
icon: mdi:account
140
+
```
141
+
142
+
### Template Title card with Mushroom
143
+
144
+
If you need templates in your title, you can make good use of the Mushroom cards. Here's an example using the [Mushroom title card](//github.com/piitaya/lovelace-mushroom/blob/main/docs/cards/title.md).
145
+
https:
146
+
147
+
```yaml
148
+
- type: custom:expander-card
149
+
title-card:
150
+
type: custom:mushroom-title-card
151
+
title: |-
152
+
{{ now().hour }}
153
+
```
154
+
155
+
### Simple Title
125
156
126
157
Example with title that is clickable and has 2 nested cards.
127
158
@@ -186,6 +217,32 @@ Example with title that is clickable and has 2 nested cards with are automatical
186
217
show_wind: speed
187
218
```
188
219
220
+
### Title card with action
221
+
222
+
The configuration below will open or close the expander when you tap the Mushroom Light Card. This means you cannot switch the light on or off by tapping it, but you can still adjust the brightness.
223
+
224
+
```yaml
225
+
type: custom:expander-card
226
+
title: Expander Card
227
+
expander-card-id: my-light-card
228
+
cards:
229
+
- type: entities
230
+
entities:
231
+
- entity: sun.sun
232
+
title-card:
233
+
type: tile
234
+
entity: light.bed_light
235
+
vertical: false
236
+
features_position: inline
237
+
features:
238
+
- type: light-brightness
239
+
tap_action:
240
+
action: fire-dom-event
241
+
expander-card:
242
+
data:
243
+
expander-card-id: my-light-card
244
+
action: toggle
245
+
```
189
246
## Set state via action
190
247
191
248
You can set the state of expander card(s) using the `fire-dom-event` action on any card that supports actions.
@@ -231,11 +288,11 @@ tap_action:
231
288
232
289
You can do advanced styling using the `style` configuration parameter. Classes available are per the images below.
Before the `style` attribute, [card mod](https://github.com/thomasloven/lovelace-card-mod) was used to style the card. Although card-mod still works, it is better to switch everything to use the `style` attribute. Please do not open issue(s) when card mod is not working.
0 commit comments