DialogState

@Stable
class DialogState @RememberInComposition constructor(position: WindowPosition = WindowPosition.PlatformDefault, size: Dimension? = null)

A state object that can be hoisted to control and observe a Dialog's geometry.

Both properties are two-way: assigning to them repositions or resizes the realized dialog, and a user dragging or resizing the dialog writes the new geometry back into the state.

Parameters

position

the initial value for position

size

the initial value for size; a null size sizes the dialog to its content, while a non-null size is applied verbatim

See also

Constructors

Link copied to clipboard
@RememberInComposition
constructor(position: WindowPosition = WindowPosition.PlatformDefault, size: Dimension? = null)

Properties

Link copied to clipboard
var height: Int

The current height of the dialog, in pixels.

Link copied to clipboard

The current top-left position of the dialog on screen.

Link copied to clipboard

The current size of the dialog, a width/height pair in pixels.

Link copied to clipboard
var width: Int

The current width of the dialog, in pixels.