Popup

fun TileSchemaBuilderScope.Popup(id: String = randomId(), style: StyleSchemaBuilderScope.() -> Unit = {}, visibility: TileSchema.Visibility = visible(), searchableTerms: List<String>? = null, expanded: Boolean = false, alignment: AlignmentSchema.TwoDimensional = alignToTopStart(), offsetX: Int = 0, offsetY: Int = 0, focusable: Boolean = false, dismissOnBackPress: Boolean = true, dismissOnClickOutside: Boolean = true, events: EventSchemaBuilderScope.() -> Unit = {}, tiles: TileSchemaBuilderScope.() -> Unit, popupTiles: TileSchemaBuilderScope.() -> Unit)

Renders an anchor — tiles, laid out with Box semantics and carrying style and visibility — with a floating popup containing popupTiles over it. The popup is only composed while expanded is true. alignment places the popup relative to the anchor's bounds, and offsetX / offsetY (in dp) are applied on top of that: top/bottom alignments put the popup fully above/below the anchor with offsetY as the gap, start/end-center alignments put it fully to the side with offsetX as the gap (mirrored under RTL), and corner alignments flush-align the popup's matching edge with the anchor's, with offsetX as a plain translation. The final position is clamped to the window, so the popup can never be pushed off screen. focusable, dismissOnBackPress and dismissOnClickOutside control how it can be dismissed. A dismissal (back press, tap outside) flips expanded locally on the client, with no server round trip needed; opening and closing from the server side is done with a TogglePopup event pointing at this tile's id — typically wired to the anchor's click. style and visibility apply to the anchor only — the popup renders in its own window, unaffected by them, and its content is unstyled and undecorated, so wrap popupTiles in a Card or a styled Box for a surface behind it. Dispatches no triggers at all — wire events on the anchor and popup tiles instead.

Parameters

id

Unique identifier of the tile. Defaults to a random id.

style

Layout/appearance modifiers applied to the anchor (size, padding, background, etc).

visibility

Whether the anchor is shown, hidden but occupies space, or removed from layout. Defaults to visible.

searchableTerms

Terms used by an ancestor's search/filter to decide whether this tile matches. Defaults to none.

expanded

Whether the popup starts open. Defaults to false.

alignment

Placement of the popup relative to the anchor's bounds. Defaults to top start.

offsetX

Horizontal offset applied on top of alignment, in dp. Defaults to 0.

offsetY

Vertical offset applied on top of alignment, in dp. Defaults to 0.

focusable

Whether the popup can take focus (e.g. for text input inside it). Defaults to false.

dismissOnBackPress

Whether pressing back dismisses the popup. Defaults to true.

dismissOnClickOutside

Whether tapping outside the popup dismisses it. Defaults to true.

events

Events owned by this tile. Never fired, since the tile dispatches no triggers.

tiles

Child tiles forming the anchor the popup is attached to.

popupTiles

Child tiles rendered inside the floating popup.