Box

data class Box(val width: Constraint = Constraint.Wrap, val height: Constraint = Constraint.Wrap, val margin: Margin = Margin.Zero, val horizontalAlignment: CrossAxisAlignment = CrossAxisAlignment.Start, val verticalAlignment: CrossAxisAlignment = CrossAxisAlignment.Start, val children: BoxScope.() -> Unit)

Lays out widgets along the z-axis in a column.

Minimum and maximum heights do not include margins.

Constructors

Link copied to clipboard
constructor(width: Constraint = Constraint.Wrap, height: Constraint = Constraint.Wrap, margin: Margin = Margin.Zero, horizontalAlignment: CrossAxisAlignment = CrossAxisAlignment.Start, verticalAlignment: CrossAxisAlignment = CrossAxisAlignment.Start, children: BoxScope.() -> Unit)

Properties

Link copied to clipboard

A slot to add widgets in.

Link copied to clipboard
val height: Constraint

Sets whether the box's height will match its tallest child (Constraint.Wrap) or match the height of its parent (Constraint.Fill).

Link copied to clipboard
val horizontalAlignment: CrossAxisAlignment

Sets the default horizontal alignment for widgets in this Box.

Link copied to clipboard
val margin: Margin

Applies margin (space) around the box.

Link copied to clipboard
val verticalAlignment: CrossAxisAlignment

Sets the default vertical alignment for widgets in this Box.

Link copied to clipboard
val width: Constraint

Sets whether the box's width will match its widest child (Constraint.Wrap) or match the width of its parent (Constraint.Fill).