🌈 Create new beautiful Compose Gradients with our new wesite ->
Composable Function

RemoteFitBox

Layout container that renders the first child that fits within available constraints.

RemoteFitBox

Source set: Android
@Composable
public fun RemoteFitBox(
    modifier: RemoteModifier = RemoteModifier,
    horizontalAlignment: RemoteAlignment.Horizontal = RemoteAlignment.CenterHorizontally,
    verticalArrangement: RemoteArrangement.Vertical = RemoteArrangement.Center,
    content: @RemoteComposable @Composable () -> Unit = {},
)

Layout container that renders the first child that fits within available constraints.

Functions as a RemoteBox and acts as an alternative-selector container during playback.

Selection behavior:

    within available constraints.

  • Measures children sequentially and renders only the first child whose width and height fit
  • Matches container dimensions to the measured size of the selected child.
  • Hides completely (GONE) if no child fits within the constraints.

Parameters

modifier modifier applied to this layout
horizontalAlignment horizontal alignment for children
verticalArrangement vertical arrangement for children
content composable children to lay out inside this RemoteFitBox

Content updated: