Alignment

@Stable
fun interface Alignment

Where a child sits within the extent its container offers it: an Alignment places a child across both axes of a Box, an Alignment.Horizontal across a Column, an Alignment.Vertical across a Row.

An alignment answers one question - given the child's extent and the extent available to it, how far from the top left of that extent does the child start. Column, Row and Box apply the one they are declared with to every child, and a child names its own through align on ColumnScope, RowScope or BoxScope.

See also

Inheritors

Types

Link copied to clipboard
object Companion

The standard alignments: nine placing a child on both axes, three across a height, three across a width.

Link copied to clipboard
@Stable
fun interface Horizontal

Horizontal placement of a child within the width available to it, resolved against the container's ComponentOrientation.

Link copied to clipboard
@Stable
fun interface Vertical

Vertical placement of a child within the height available to it.

Functions

Link copied to clipboard
abstract fun align(size: Dimension, space: Dimension, orientation: ComponentOrientation): Point

The child's offset from the top left of space, for a child of extent size in a container laid out under orientation.