Hi everybody! Release day for navbar-card 🎉 Just a small new feature, and some quick fixes for this one
More configuration options for badges
Badges are now more customizable than ever. Previous versions of navbar-card allowed to change the color of the badge manually, and use JSTemplates to decide when it should be shown.
With this new release, you can now use JSTemplates also for the color of the badge, and provide an optional count
value to be displayed inside (also using templates).
The color of the text will be automagically calculated to offer the best contrast, but even that can be modified if needed, using the new prop textColor
, which, once again, supports JSTemplate configuration.
type: custom:navbar-card
...
routes:
...
- icon: mdi:information-outline
badge:
show: "[[[return states['sensor.offline_devices'].state > 0; ]]]"
color: "[[[ return states['input_text.custom_error_color'] ]]]"
count: "[[[return states['sensor.offline_devices'].state; ]]]"
textColor: white