Button control¶
A Button is an interactive control that performs an action when the user presses it. It can open entity details, toggle an entity, call a Home Assistant action, navigate to another view, or work without an entity when the action already contains its own target.
This page shows how to add a button, choose its content and appearance, and connect tap, hold, or double-tap actions.
Add a Button¶
This button opens more information for the selected entity:
Show text, an icon, or both¶
Choose the content arrangement with content.mode:
| Mode | Result |
|---|---|
content_text | Text centered in the button |
content_icon | Icon centered in the button |
content_horizontal | Icon/text/items next to each other |
content_vertical | Icon/text/items above and below each other |
For a Button, the content direction is controlled by content.mode: use content_horizontal or content_vertical. The separate orientation field is not used by the current Button control.
Change the Button appearance¶
Choose a complete button surface or a quieter indicator-line visualization:
show.item_style accepts: filled_round— filled Button with rounded corners.filled_square— filled Button with square corners.outlined_round— outlined Button with rounded corners.outlined_square— outlined Button with square corners.
show.item_viz accepts viz_button and viz_line. viz_button uses the complete Button surface for its active/inactive appearance. viz_line keeps the Button clickable but shows the state emphasis as an indicator line. show.item_variant currently has one value: default.
Use tap, hold, or double tap¶
A Button can define tap_action, hold_action, and double_tap_action independently. See Actions for the supported actions.
Use a Button without an entity¶
No entity_index is needed when the action already contains everything it needs:
Configuration options¶
Required applies to the specific form described by that table: Yes means you need the field for that form; No means you can leave it out. Not set means the card adds no explicit value when the option is omitted.
| Option | Type | Required | Default | Description |
|---|---|---|---|---|
type: button | string | Yes | — | Selects the Button control. |
entity_index | entity index | No | Not set | Entity used by content and entity-based actions. |
xpos, ypos | number | Yes | — | Position of the Button center on the card. |
width | number | No | 20 | Width of the complete clickable Button. |
height | number | No | 10 | Height of the complete clickable Button. |
content | mapping | No | content_horizontal | Text, icon, entity information, or compact visual content. content.mode selects content_text, content_icon, content_horizontal, or content_vertical. |
background | mapping | No | Radius 2 | Sets the complete Button surface radius and base styles before the selected visual style/state is applied. |
show.item_variant | default | No | default | Uses the current Button form. |
show.item_viz | viz_button, viz_line | No | viz_button | viz_button emphasizes the full Button surface; viz_line emphasizes an indicator line. |
show.item_style | filled_round, filled_square, outlined_round, outlined_square | No | filled_square | Chooses filled/outlined surfaces with rounded/square corners. |
tap_action | mapping | No | toggle | Action run when the Button is tapped; the default toggles the selected entity. |
hold_action | mapping | No | Not set | Optional separate action run when the Button is held. |
double_tap_action | mapping | No | Not set | Optional separate action run when the Button is double-tapped. |
label | mapping | No | Not set | Optional label beside/above the Button. |
visibility | visible, hidden, unavailable / template | No | visible | visible shows the Button normally, hidden hides it, and unavailable shows its unavailable appearance and prevents normal interaction. |