A popup menu allows you to group multiple routes under a single navbar item. To trigger a popup, you must use the open-popup action within either a tap_action or a hold_action on the parent route.
Popup Item Configuration:
Popup items share many properties with standard routes, including url, icon, image, badge, label, selected, and custom actions.
Dynamic Popups with JSTemplate:
You can use JSTemplate to dynamically generate popup items based on your Home Assistant state (e.g., generating a list of rooms from your configured areas).
Example: Dynamic Area Popup
This example creates a 'Rooms' route that, when tapped, opens a popup containing all areas defined in Home Assistant:
- icon: mdi:sofa-outline
icon_selected: mdi:sofa
label: Rooms
tap_action: { action: open-popup }
popup: |
[[[
return Object.values(hass.areas).map(area => ({
label: area.name,
url: "/d-bubble/home#" + area.area_id,
icon: area.icon
}));
]]]