Skip to content

Components Actions

Dropdown menu

A menu that opens under its button. It is a native popover: it closes on Escape or a click elsewhere, with no script.

$ pyblade ui:add dropdown-menu

Props

Written as attributes of <pb-ui.dropdown-menu>; put a colon before one to pass it a Python value, as in :items="items". A slot is written <pb-slot:name>.

NameTypeDefaultDescription
id str required Unique on the page: the button opens the popover of that id
label str "Open" The text of the button
variant str "outline" outline, ghost or primary
align str "start" start or end: which edge of the button the menu lines up with
class str "" Added to the classes of the component. Every other attribute is spread on it too.

Used with <pb-ui.dropdown-item>, <pb-ui.dropdown-label>, which pyblade ui:add dropdown-menu adds with it.