A simple but extremely customizable HA button card.
I got very tired of not being able to adjust fonts and icons the exact way I wanted without using HTML inside the very raw custom:button-card. Even simple stuff like font size was simply not adjustable, much less templatable.
So I started coding this card with the help of GPT 5.4/5.5 Codex and I added everything that I had missed. You can template just about everything, you can make the icon as big as you want, you can make it transparent, you can make the icon change with simple templates...but it does support state icons and state colors natively :)
You can install using HACS:
Or manually add the card as a Lovelace resource:
- URL:
/path/to/simple-button-card.js - Type:
module
- Native Home Assistant
tap_action,hold_action, anddouble_tap_action - Optional entity-backed
state-badgeicon rendering - Live
icon_color_templateupdates - Template-driven icon, title, and subtext content
- Template-driven icon, title, and subtext sizes
- Optional subtext displayed above or below the main title
- Optional icon top-attach mode
- Optional transparent mode that removes both the card background and shadow
- Built-in visual editor with
Icon,Title,Subtext, andInteractionssections - Section view sizing through
grid_options
type: custom:simple-button-card
entity: sensor.ev_battery
icon_template: mdi:car-electric
icon_color_template: >
{% set level = states('sensor.ev_battery') | int(0) %}
{{ '#4CAF50' if level >= 80 else '#FFB300' if level >= 30 else '#F44336' }}
icon_size_template: "84"
text_template: "{{ states('sensor.ev_battery') }}%"
text_size_template: "28"
secondary_text_template: "{{ states('sensor.ev_range') }} mi"
secondary_text_size_template: "13"
secondary_text_above: false
icon_attach_top: false
transparent_mode: false
text_weight: 600
secondary_text_weight: 400
text_padding_top: 0
text_padding_bottom: 0
secondary_text_padding_top: 0
secondary_text_padding_bottom: 0
icon_padding_top: 0
icon_padding_bottom: 0
side_padding: 16
tap_action:
action: more-info
hold_action:
action: navigate
navigation_path: /dashboard-mobile/ev
double_tap_action:
action: url
url_path: https://example.com
grid_options:
rows: 3
columns: 3entitytransparent_modeside_paddinggrid_options.rowsgrid_options.columns
icon_templateicon_color_templateicon_size_templateicon_attach_topicon_padding_topicon_padding_bottom
text_templatetext_size_templatetext_weighttext_padding_toptext_padding_bottom
secondary_text_templatesecondary_text_size_templatesecondary_text_weightsecondary_text_padding_topsecondary_text_padding_bottomsecondary_text_above
tap_actionhold_actiondouble_tap_action
- Size template fields should be strings in YAML, for example
icon_size_template: "90". - If a size template is blank or resolves to an invalid value, the card falls back to built-in defaults:
72for icon size,24for title size, and13for subtext size. - If
text_templateis blank, the card falls back to the entity state and unit, thenfriendly_name. - If
secondary_text_templateis blank, no subtext is shown. - If
icon_templateis blank andentityis provided, Home Assistant handles the icon throughstate-badge. icon_attach_top: truepins the icon wrapper to the top and ignores icon top/bottom padding.secondary_text_above: truerenders subtext above the main title.transparent_mode: truemakes the card fully visually transparent by clearing both the background and the card shadow.
Full disclaimer: This was fully vibe coded by GPT 5.4 Codex. However, I personally use this card and I am happy with it, so I decided to post in case it could help anyone else.
