A different take on designing a Lovelace UI

@Mariusthvdb

Try this, before the action it will check if it is editMode or not. And dont have to use ‘action’, this is for HA action service. You can add template action for tap…

type: custom:button-card
name: Terug
icon: mdi:arrow-left
tap_action:
  back_navigate: |
    [[[ 
      const isEditor = this.editMode;
        if (isEditor) {
          return;
        }
      return window.history.back(); 
    ]]]
type: custom:button-card
icon: mdi:menu
show_name: false
tap_action:
  toggle_menu: |
    [[[ this.dispatchEvent(new Event('hass-toggle-menu', { bubbles: true,
          composed: true })); ]]]

Through devtools, you can check what properties are available for a button

2 Likes