PetalComponents.Dropdown (petal_components v4.15.1)

Copy Markdown View Source

The panel that hangs off a trigger, and the rows that go inside it.

Where the panel opens: side and align

Two questions, one attribute each. side is which side of the trigger the panel sits on: "bottom" is the ordinary menu, "top" opens it upward, and "left" / "right" open it beside the trigger instead of over the thing it belongs to - the account panel a sidebar pushes out into the content area. align is how the panel lines up along the other axis: "start" puts the leading edges flush, "end" the trailing ones. Above or below that reads horizontally (start grows the panel rightward, end grows it leftward); beside, it reads vertically (start aligns the tops, end aligns the bottoms).

Leave side out and the panel opens downward and measures on every open, flipping upward when the viewport leaves no room below it. Name a side and there is nothing left to measure, so the hook never attaches.

placement and direction are the older spelling of the same two questions. They keep working, unchanged, forever; prefer side and align in new code:

legacyprefer
placement="left"align="end"
placement="right"align="start"
direction="up"side="top"
direction="down"side="bottom"
direction="auto"no side (the measured default)

Pass both spellings and side / align win.

Summary

Functions

<.dropdown label="Dropdown">

A non-interactive heading for a group of menu items.

A row of panel content that is a control rather than a command - a theme switcher, a plan badge, a storage meter. Same padding and type scale as a menu item, but it never behaves like one.

A thin divider between groups of menu items.

Functions