Repository navigation
Feature Enter Leave Actions
tempus2016 edited this page Sep 27, 2026
·
1 revision
Run a Home Assistant action whenever a tab becomes active (enter_action) or stops being active (leave_action). For example, open the Cameras tab to wake the cameras and leave it to put them back to sleep, or turn on a light when a room's tab is opened.
Per-tab keys: enter_action, leave_action (standard HA action objects)
type: custom:tabdeck-card
tabs:
- name: Home
card: { ... }
- name: Cameras
icon: mdi:cctv
enter_action:
action: perform-action
perform_action: script.turn_on
target: { entity_id: script.cameras_wake }
leave_action:
action: perform-action
perform_action: script.turn_on
target: { entity_id: script.cameras_sleep }
card: { ... }- On every change of the active tab, from any source: tap, keyboard, swipe,
auto_select,auto_rotate,idle_return, liveremember: entitysync, or scroll-spy tracking. - The old tab's
leave_actionruns first, then the new tab'senter_action. - Not on initial load, and not when the already-active tab is tapped again.
- Each open copy of the dashboard runs its own actions. If a wall panel and a phone both show the deck, both fire, so make the actions safe to repeat (turning something on is safer than toggling it).
perform-action (what the editor's action picker writes), the legacy call-service, navigate, url, more-info, toggle, fire-dom-event. action: none counts as no action.
perform-actionalso works fortap_action,hold_actionandbadge_action. Before this release those silently ignoredperform-action.
Both are available in the visual editor as Action when this tab is opened / Action when leaving this tab.
Concepts
Features
- All features
- Dynamic tabs
- Remote control & events
- PIN-locked tabs
- Reuse: defaults & templates
- Debug panel
- State-driven icons & names
- Alert pulse
- Auto-rotate & idle return
- Navigation & action tabs
- Scroll-spy
- Collapsible deck
- Responsive layouts
- Style presets
- Tab-change actions
- Tab display mode
- Accent indicator
- Extra bar styles
- Indicator thickness
- Sticky tab bar
- Tab alignment
- Badge display mode
- Per-tab colour
- Tab subtitles
- Disabled tabs
- Multiple cards per tab
- Panel transitions
- Content layout
- Duplicate tab
- Expand/Collapse all
- Edit mode helpers
- Why is this tab hidden?
- Starter templates
- Convert from another card
- Languages
- Dock & floating action tabs
- Dots & content arrows
- Grouped tabs
- Search & shortcuts
- Arrange tabs