androidx.compose.foundation.layout

padding

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

No hand-written docs yet.

Apply additional space along each edge of the content in Dp: start, top, end and bottom. The start and end edges will be determined by the current LayoutDirection. Padding is applied before content measurement and takes precedence; content may only be as large as the remaining space.

With start, top, end, bottom

fun Modifier.padding(
    start: Dp = 0.dp,
    top: Dp = 0.dp,
    end: Dp = 0.dp,
    bottom: Dp = 0.dp,
)

start: DpOptional

Default: 0.dp

Not described.

top: DpOptional

Default: 0.dp

Not described.

end: DpOptional

Default: 0.dp

Not described.

bottom: DpOptional

Default: 0.dp

Not described.

With horizontal, vertical

fun Modifier.padding(
    horizontal: Dp = 0.dp,
    vertical: Dp = 0.dp,
)

horizontal: DpOptional

Default: 0.dp

Not described.

vertical: DpOptional

Default: 0.dp

Not described.

With all

fun Modifier.padding(all: Dp)

all: DpRequired

Not described.

With paddingValues

fun Modifier.padding(paddingValues: PaddingValues)

paddingValues: PaddingValuesRequired

Not described.

Library docs

Apply additional space along each edge of the content in Dp: start, top, end and bottom. The start and end edges will be determined by the current LayoutDirection. Padding is applied before content measurement and takes precedence; content may only be as large as the remaining space.

Negative padding is not permitted — it will cause IllegalArgumentException. See Modifier.offset.

Example usage: