Scope for configuring flex item properties. Properties are read during the layout/measure phase, not during composition.

See also
FlexConfig

Summary

Public functions

Unit

Aligns items to a specific baseline.

Cmn
Unit
alignSelfToBaseline(alignmentLineBlock: (Measured) -> Int)

Aligns items to a custom baseline.

Cmn
Unit
basis(value: Dp)

Sets the basis to a fixed Dp value.

Cmn
Unit
basis(value: @FloatRange(from = 0.0, to = 1.0) Float)

Sets the basis to a percentage of the container's main axis size.

Cmn

Public properties

FlexAlignSelf

Overrides the container's FlexBoxConfigScope.alignItems for this specific item.

Cmn
FlexBasis

The initial main size of this item before flex distribution.

Cmn
Int

The maximum size of the FlexBox container along the cross axis.

Cmn
Int

The minimum size of the FlexBox container along the cross axis.

Cmn
Int

The maximum size of the FlexBox container along the main axis.

Cmn
Int

The minimum size of the FlexBox container along the main axis.

Cmn
Float

The flex grow factor.

Cmn
Int

The visual order of this item relative to siblings.

Cmn
Float

The flex shrink factor.

Cmn

Inherited functions

From androidx.compose.ui.unit.Density
open Int

Convert Dp to Int by rounding

Cmn
open Int

Convert Sp to Int by rounding

Cmn
open Dp

Convert an Int pixel value to Dp.

Cmn
open Dp

Convert a Float pixel value to a Dp

Cmn
open DpSize

Convert a Size to a DpSize.

Cmn
open Float

Convert Dp to pixels.

Cmn
open Float

Convert Sp to pixels.

Cmn
open Rect

Convert a DpRect to a Rect.

Cmn
open Size

Convert a DpSize to a Size.

Cmn
open TextUnit

Convert an Int pixel value to Sp.

Cmn
open TextUnit

Convert a Float pixel value to a Sp

Cmn
From androidx.compose.ui.unit.FontScaling
open Dp

Convert Sp to Dp.

Cmn
open TextUnit

Convert Dp to Sp.

Cmn

Inherited properties

From androidx.compose.ui.unit.Density
Float

The logical density of the display.

Cmn
From androidx.compose.ui.unit.FontScaling
Float

Current user preference for the scaling factor for fonts.

Cmn

Public functions

alignSelfToBaseline

fun alignSelfToBaseline(alignmentLine: AlignmentLine): Unit

Aligns items to a specific baseline. Overrides alignSelf when set.

alignSelfToBaseline

fun alignSelfToBaseline(alignmentLineBlock: (Measured) -> Int): Unit

Aligns items to a custom baseline. Overrides alignSelf when set.

basis

fun basis(value: Dp): Unit

Sets the basis to a fixed Dp value.

basis

fun basis(value: @FloatRange(from = 0.0, to = 1.0) Float): Unit

Sets the basis to a percentage of the container's main axis size.

Parameters
value: @FloatRange(from = 0.0, to = 1.0) Float

A value between 0.0 and 1.0 representing the percentage.

Public properties

alignSelf

var alignSelfFlexAlignSelf

Overrides the container's FlexBoxConfigScope.alignItems for this specific item.

basis

var basisFlexBasis

The initial main size of this item before flex distribution.

flexBoxCrossAxisMax

val flexBoxCrossAxisMaxInt

The maximum size of the FlexBox container along the cross axis.

This corresponds to Constraints.maxHeight if the direction is FlexDirection.Row or FlexDirection.RowReverse, and Constraints.maxWidth if the direction is FlexDirection.Column or FlexDirection.ColumnReverse.

flexBoxCrossAxisMin

val flexBoxCrossAxisMinInt

The minimum size of the FlexBox container along the cross axis.

This corresponds to Constraints.minHeight if the direction is FlexDirection.Row or FlexDirection.RowReverse, and Constraints.minWidth if the direction is FlexDirection.Column or FlexDirection.ColumnReverse.

flexBoxMainAxisMax

val flexBoxMainAxisMaxInt

The maximum size of the FlexBox container along the main axis.

This corresponds to Constraints.maxWidth if the direction is FlexDirection.Row or FlexDirection.RowReverse, and Constraints.maxHeight if the direction is FlexDirection.Column or FlexDirection.ColumnReverse.

flexBoxMainAxisMin

val flexBoxMainAxisMinInt

The minimum size of the FlexBox container along the main axis.

This corresponds to Constraints.minWidth if the direction is FlexDirection.Row or FlexDirection.RowReverse, and Constraints.minHeight if the direction is FlexDirection.Column or FlexDirection.ColumnReverse.

grow

var growFloat

The flex grow factor.

When positive, the item grows to absorb free space along the main axis. Growth is proportional to this value relative to siblings' grow factors.

Note: Items will grow even with explicit size constraints. Set grow = 0f to prevent growth.

order

var orderInt

The visual order of this item relative to siblings. Items are sorted by order in ascending order before layout, with lower values appearing first. Items with the same order maintain their original declaration order.

Default is 0. Use negative values to move items before default-ordered items, or positive values to move items after.

shrink

var shrinkFloat

The flex shrink factor.

When positive, the item can shrink if items exceed the container's main axis size. Shrinking is proportional to this value and the item's base size.

Note: Items will not shrink below their minimum intrinsic size. Items with explicit size modifiers will not shrink at all.