Button control¶
A button gives the user a clear command inside the card. Use it to open entity details, toggle an entity, navigate to another view, open a URL, or perform a Home Assistant action.
A button can use the entity connected through entity_index, or it can act without an entity when its action already contains a target, path, or URL. See Actions for all supported actions.
Basic configuration¶
This button opens the more-info dialog for the first card entity:
Entity and action settings
entity_index: 0 connects the button to the first entry in entities. The button can omit entity_index when its action already specifies a target, path, or URL. See Entities for entity indexes and optional slots, and Actions for action configuration.
Configuration options¶
| Option | Description |
|---|---|
type: button | Adds a button control. |
entity_index | Entity used by the button content and by actions such as more-info or toggle. |
xpos, ypos | Position of the button in the card. |
width, height | Size of the button. |
orientation | Arranges the button horizontally or vertically. |
content | Text, icon, entity information, or compact visual content shown inside the button. |
show.item_viz | Shows a complete button with viz_button or an active indicator with viz_line. |
show.item_style | Uses filled_round, filled_square, outlined_round, or outlined_square. |
tap_action | Action performed when the user taps the button. |
hold_action | Action performed when the user holds the button. |
double_tap_action | Action performed when the user double-taps the button. |
label | Optional text positioned beside or above the button. |
visibility | Shows, hides, or disables the button. |
See Positioning and sizing for coordinates and dimensions.
Button content¶
A button can show text, an icon, or both. Choose the arrangement with content.mode:
| Mode | Content |
|---|---|
content_text | Text centered in the button. |
content_icon | An icon centered in the button. |
content_horizontal | Icon and text arranged next to each other. |
content_vertical | Icon and text arranged above and below each other. |
For a compact status display, horizontal and vertical content can also contain an items list with entity values or visual tools:
The content is visual. Tapping anywhere on the button performs the button action.
Button appearance¶
Use viz_button for a conventional button surface. Use viz_line when the button should keep a quieter background and indicate its active state with a line.
Button without an entity¶
An entity is not needed when the action already identifies what should happen: