Function

padding

Apply additional space along each edge of the content in Dp: left, right.

RevenueCat

RevenueCat

Add subscriptions to your apps in minutes

Ad Get started for free
Android
Deprecated Use padding with start and end instead

padding

public fun SubspaceModifier.padding(left: Dp = 0.dp, right: Dp = 0.dp): SubspaceModifier

Apply additional space along each edge of the content in Dp: left, right. 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.


padding

Android
public fun SubspaceModifier.padding(
    start: Dp = 0.dp,
    top: Dp = 0.dp,
    end: Dp = 0.dp,
    bottom: Dp = 0.dp,
    front: Dp = 0.dp,
    back: Dp = 0.dp,
): SubspaceModifier

Apply additional space along each edge of the content in Dp: start, top, end, bottom, front and back. 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. To not consider the layout direction when applying the padding, see absolutePadding.

Negative padding is not permitted — it will cause IllegalArgumentException.

Parameters

start The amount of space at the start edge of the content. Start edge is left if the layout direction is LTR, or right for RTL.
top The amount of space at the top edge of the content.
end The amount of space at the end edge of the content. End edge is right if the layout direction is LTR, or left for RTL.
bottom The amount of space at the bottom edge of the content.
front The amount of space at the front edge of the content.
back The amount of space at the back edge of the content.

padding

Android
public fun SubspaceModifier.padding(
    horizontal: Dp = 0.dp,
    vertical: Dp = 0.dp,
    depth: Dp = 0.dp,
): SubspaceModifier

Apply horizontal dp space along the left and right edges of the content, vertical dp space along the top and bottom edges, and depth dp space along front and back edged. 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 padding

Parameters

horizontal The amount of space at the left and right edges of the content.
vertical The amount of space at the top and bottom edges of the content.
depth The amount of space at the front and back edges of the content.

padding

Android
public fun SubspaceModifier.padding(all: Dp): SubspaceModifier

Apply all dp of additional space along each edge of the content, left, top, right, bottom, front, and back. 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 padding

Parameters

all The amount of space at each edge of the content.