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
start: DpOptionalDefault: 0.dp
Not described.
top: DpOptional
top: DpOptionalDefault: 0.dp
Not described.
end: DpOptional
end: DpOptionalDefault: 0.dp
Not described.
bottom: DpOptional
bottom: DpOptionalDefault: 0.dp
Not described.
With horizontal, vertical
fun Modifier.padding(
horizontal: Dp = 0.dp,
vertical: Dp = 0.dp,
)
horizontal: DpOptional
horizontal: DpOptionalDefault: 0.dp
Not described.
vertical: DpOptional
vertical: DpOptionalDefault: 0.dp
Not described.
With all
fun Modifier.padding(all: Dp)
all: DpRequired
all: DpRequiredNot described.
With paddingValues
fun Modifier.padding(paddingValues: PaddingValues)
paddingValues: PaddingValuesRequired
paddingValues: PaddingValuesRequiredNot 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: