androidx.compose.foundation.layout

paddingFromBaseline

Function · from org.jetbrains.compose.foundation:foundation-layout:1.12.2

No hand-written docs yet.

A Modifier that positions the content in a layout such that the distance from the top of the layout to the [baseline of the first line of text in the content]FirstBaseline is top, and the distance from the [baseline of the last line of text in the content]LastBaseline to the bottom of the layout is bottom.

Form 1

fun Modifier.paddingFromBaseline(
    top: Dp = Dp.Unspecified,
    bottom: Dp = Dp.Unspecified,
)

top: DpOptional

Default: Dp.Unspecified

Not described.

bottom: DpOptional

Default: Dp.Unspecified

Not described.

Form 2

fun Modifier.paddingFromBaseline(
    top: TextUnit = TextUnit.Unspecified,
    bottom: TextUnit = TextUnit.Unspecified,
)

top: TextUnitOptional

Default: TextUnit.Unspecified

Not described.

bottom: TextUnitOptional

Default: TextUnit.Unspecified

Not described.

Library docs

A Modifier that positions the content in a layout such that the distance from the top of the layout to the [baseline of the first line of text in the content]FirstBaseline is top, and the distance from the [baseline of the last line of text in the content]LastBaseline to the bottom of the layout is bottom.

When the modified layout is min height constrained and the padded layout is smaller than the constraint, the modified layout will satisfy the min constraint and the content will be positioned to satisfy the top requirement if specified, or the bottom requirement otherwise.

Example usage: