Google is committed to advancing racial equity for Black communities. See how.

androidx.compose.foundation.layout

Interfaces

BoxScope

A BoxScope provides a scope for the children of a Box.

ColumnScope

Scope for the children of Column.

ConstraintSet

Immutable description of the constraints used to layout the children of a ConstraintLayout.

Dimension

Represents a dimension that can be assigned to the width or height of a ConstraintLayoutConstrainedLayoutReference.

RowScope

Scope for the children of Row.

Classes

ChainStyle

The style of a horizontal or vertical chain.

ConstrainedLayoutReference

Represents a layout within a ConstraintLayout.

ConstrainScope

Scope used by Modifier.constrainAs.

ConstraintLayoutBaseScope

Common scope for ConstraintLayoutScope and ConstraintSetScope, the content being shared between the inline DSL API and the ConstraintSet-based API.

ConstraintLayoutScope

Scope used by the inline DSL of ConstraintLayout.

ConstraintSetScope

Scope used by the ConstraintSet DSL.

PaddingValues

Describes a padding to be applied along the edges inside a box.

State

The state of the ConstraintLayout solver.

Type-aliases

FlowMainAxisAlignment

Annotations

ExperimentalLayout

LayoutScopeMarker

Enums

FlowCrossAxisAlignment

Used to specify the alignment of a layout's children, in cross axis direction.

IntrinsicSize

Intrinsic size used in preferredWidth or preferredHeight which can refer to width or height.

MainAxisAlignment

Used to specify the alignment of a layout's children, in main axis direction.

SizeMode

Used to specify how a layout chooses its own size when multiple behaviors are possible.

Top-level functions summary

Unit
Box(modifier: Modifier = Modifier, contentAlignment: Alignment = Alignment.TopStart, content: BoxScope.() -> Unit)

A layout composable with content.

Unit
Box(modifier: Modifier)

A box with no content that can participate in layout, drawing, pointer input due to the modifier applied to it.

Unit
Column(modifier: Modifier = Modifier, verticalArrangement: Arrangement.Vertical = Arrangement.Top, horizontalAlignment: Alignment.Horizontal = Alignment.Start, content: ColumnScope.() -> Unit)

A layout composable that places its children in a vertical sequence.

Unit
ConstraintLayout(modifier: Modifier = Modifier, content: ConstraintLayoutScope.() -> Unit)

Layout that positions its children according to the constraints between them.

Unit
ConstraintLayout(constraintSet: ConstraintSet, modifier: Modifier = Modifier, content: () -> Unit)

Layout that positions its children according to the constraints between them.

ConstraintSet
ConstraintSet(description: ConstraintSetScope.() -> Unit)

Creates a ConstraintSet.

Unit
FlowColumn(mainAxisSize: SizeMode = SizeMode.Wrap, mainAxisAlignment: FlowMainAxisAlignment = FlowMainAxisAlignment.Start, mainAxisSpacing: Dp = 0.dp, crossAxisAlignment: FlowCrossAxisAlignment = FlowCrossAxisAlignment.Start, crossAxisSpacing: Dp = 0.dp, lastLineMainAxisAlignment: FlowMainAxisAlignment = mainAxisAlignment, content: () -> Unit)

A composable that places its children in a vertical flow.

Unit
FlowRow(mainAxisSize: SizeMode = SizeMode.Wrap, mainAxisAlignment: FlowMainAxisAlignment = FlowMainAxisAlignment.Start, mainAxisSpacing: Dp = 0.dp, crossAxisAlignment: FlowCrossAxisAlignment = FlowCrossAxisAlignment.Start, crossAxisSpacing: Dp = 0.dp, lastLineMainAxisAlignment: FlowMainAxisAlignment = mainAxisAlignment, content: () -> Unit)

A composable that places its children in a horizontal flow.

Unit
Row(modifier: Modifier = Modifier, horizontalArrangement: Arrangement.Horizontal = Arrangement.Start, verticalAlignment: Alignment.Vertical = Alignment.Top, content: RowScope.() -> Unit)

A layout composable that places its children in a horizontal sequence.

Unit
Spacer(modifier: Modifier)

Component that represents an empty space layout, whose size can be defined using Modifier.width, Modifier.height and Modifier.size modifiers.

Extension functions summary

For Modifier
Modifier
Modifier.absoluteOffset(x: Dp = 0.dp, y: Dp = 0.dp)

Offset the content by (x dp, y dp).

Modifier

Offset the content by offset px.

Modifier
Modifier.absoluteOffsetPx(x: State<Float> = mutableStateOf(0f), y: State<Float> = mutableStateOf(0f))

Modifier
Modifier.absolutePadding(left: Dp = 0.dp, top: Dp = 0.dp, right: Dp = 0.dp, bottom: Dp = 0.dp)

Apply additional space along each edge of the content in Dp: left, top, right and bottom.

Modifier
Modifier.aspectRatio(@FloatRange(0.0, 3.4E38, false) ratio: Float,