padding

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

Deprecated

Use `outerPadding` or check out `innerPadding` instead.

Replace with

import com.huanshankeji.compose.foundation.layout.ext.outerPadding
this.outerPadding(start, top, end, bottom)

See the KDoc of the overload with one Dp parameter for platform differences.


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

Deprecated

Use `outerPadding` or check out `innerPadding` instead.

Replace with

import com.huanshankeji.compose.foundation.layout.ext.outerPadding
this.outerPadding(horizontal, vertical)

See the KDoc of the overload with one Dp parameter for platform differences.


Deprecated

Use `outerPadding` or check out `innerPadding` instead.

Replace with

import com.huanshankeji.compose.foundation.layout.ext.outerPadding
this.outerPadding(all)

Padding works differently on Compose UI and CSS. In Compose UI, the padding modifier adds a layer of wrapper around the component, and order of modifiers matters; while in CSS, this function delegates to the margin CSS properties.

See also


expect fun Modifier.padding(paddingValues: PaddingValues): Modifier(source)

Deprecated

Use `outerPadding` or check out `innerPadding` instead.

Replace with

import com.huanshankeji.compose.foundation.layout.ext.outerPadding
this.outerPadding(paddingValues)

See the KDoc of the overload with one Dp parameter for platform differences.

actual fun Modifier.padding(start: Dp, top: Dp, end: Dp, bottom: Dp): Modifier(source)
actual fun Modifier.padding(horizontal: Dp, vertical: Dp): Modifier(source)
actual fun Modifier.padding(paddingValues: PaddingValues): Modifier(source)
actual fun Modifier.padding(start: Dp, top: Dp, end: Dp, bottom: Dp): Modifier(source)
actual fun Modifier.padding(horizontal: Dp, vertical: Dp): Modifier(source)
actual fun Modifier.padding(paddingValues: PaddingValues): Modifier(source)