Box

Functions summary

Unit
@Composable
Box(
    modifier: GlanceModifier,
    contentAlignment: Alignment,
    content: @Composable () -> Unit
)

A layout composable with content.

Functions

Box

@Composable
fun Box(
    modifier: GlanceModifier = GlanceModifier,
    contentAlignment: Alignment = Alignment.TopStart,
    content: @Composable () -> Unit
): Unit

A layout composable with content.

By default, the Box will size itself to fit the content, unless a Dimension constraint has been provided. When the children are smaller than the Box, they will be placed within the box subject to the contentAlignment. When the content has more than one layout child, all of the children will be stacked on top of each other in the composition order.

Note for App Widgets: Box supports up to 10 child elements. Any additional elements will be truncated from the output.

Parameters
modifier: GlanceModifier = GlanceModifier

The modifier to be applied to the layout.

contentAlignment: Alignment = Alignment.TopStart

The alignment of children within the Box.

content: @Composable () -> Unit

The content inside the Box.