Element

expect interface Element : Modifier(source)
actual interface Element : Modifier(source)

Inheritors

actual interface Element : Modifier(source)

Inheritors

Types

Link copied to clipboard
value class Impl(val platformElement: Modifier.Element) : Modifier.Element
value class Impl(val platformElement: Modifier.Element) : Modifier.Element

Properties

Link copied to clipboard
abstract val platformElement: Modifier.Element
Link copied to clipboard
abstract val platformModifier: Modifier

Functions

Link copied to clipboard
expect fun Modifier.absoluteInnerPadding(left: Dp = 0.dp, top: Dp = 0.dp, right: Dp = 0.dp, bottom: Dp = 0.dp): Modifier

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

actual fun Modifier.absoluteInnerPadding(left: Dp, top: Dp, right: Dp, bottom: Dp): Modifier
actual fun Modifier.absoluteInnerPadding(left: Dp, top: Dp, right: Dp, bottom: Dp): Modifier
Link copied to clipboard
expect fun Modifier.absoluteOuterPadding(left: Dp = 0.dp, top: Dp = 0.dp, right: Dp = 0.dp, bottom: Dp = 0.dp): Modifier

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

actual fun Modifier.absoluteOuterPadding(left: Dp, top: Dp, right: Dp, bottom: Dp): Modifier
actual fun Modifier.absoluteOuterPadding(left: Dp, top: Dp, right: Dp, bottom: Dp): Modifier
Link copied to clipboard
expect fun Modifier.absolutePadding(left: Dp = 0.dp, top: Dp = 0.dp, right: Dp = 0.dp, bottom: Dp = 0.dp): Modifier

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

actual fun Modifier.absolutePadding(left: Dp, top: Dp, right: Dp, bottom: Dp): Modifier
actual fun Modifier.absolutePadding(left: Dp, top: Dp, right: Dp, bottom: Dp): Modifier
Link copied to clipboard
expect fun Modifier.alpha(alpha: Float): Modifier
actual fun Modifier.alpha(alpha: Float): Modifier
actual fun Modifier.alpha(alpha: Float): Modifier
Link copied to clipboard
expect fun Modifier.background(color: Color): Modifier

For consistency on different platforms, if used with a padding modifier, use with Modifier.outerPadding and use after it, because the padding is not within the background. Otherwise, add an outer Box and use background on it.

actual fun Modifier.background(color: Color): Modifier
actual fun Modifier.background(color: Color): Modifier
Link copied to clipboard
expect fun Modifier.border(width: Dp, color: Color): Modifier
actual fun Modifier.border(width: Dp, color: Color): Modifier
actual fun Modifier.border(width: Dp, color: Color): Modifier
Link copied to clipboard
expect fun Modifier.clickable(onClick: () -> Unit): Modifier

Has the interactive effect when clicked on the composeUi targets.

actual fun Modifier.clickable(onClick: () -> Unit): Modifier
actual fun Modifier.clickable(onClick: () -> Unit): Modifier
Link copied to clipboard
expect fun Modifier.fillMaxHeight(@FloatRange(from = 0.0, to = 1.0) fraction: Float = 1.0f): Modifier
actual fun Modifier.fillMaxHeight(@FloatRange(from = 0.0, to = 1.0) fraction: Float): Modifier
actual fun Modifier.fillMaxHeight(@FloatRange(from = 0.0, to = 1.0) fraction: Float): Modifier
Link copied to clipboard

Similar to fillMaxHeight but delegates to the stretch CSS value on JS DOM.

Link copied to clipboard
expect fun Modifier.fillMaxSize(@FloatRange(from = 0.0, to = 1.0) fraction: Float = 1.0f): Modifier
actual fun Modifier.fillMaxSize(@FloatRange(from = 0.0, to = 1.0) fraction: Float): Modifier
actual fun Modifier.fillMaxSize(@FloatRange(from = 0.0, to = 1.0) fraction: Float): Modifier
Link copied to clipboard

Similar to fillMaxSize but delegates to the stretch CSS value on JS DOM.

Link copied to clipboard
expect fun Modifier.fillMaxWidth(@FloatRange(from = 0.0, to = 1.0) fraction: Float = 1.0f): Modifier
actual fun Modifier.fillMaxWidth(@FloatRange(from = 0.0, to = 1.0) fraction: Float): Modifier
actual fun Modifier.fillMaxWidth(@FloatRange(from = 0.0, to = 1.0) fraction: Float): Modifier
Link copied to clipboard

Similar to fillMaxWidth but delegates to the stretch CSS value on JS DOM. See https://developer.mozilla.org/en-US/docs/Web/CSS/width#stretch.

Link copied to clipboard
expect open fun <R> foldIn(initial: R, operation: (R, Modifier.Element) -> R): R
actual open fun <R> foldIn(initial: R, operation: (R, Modifier.Element) -> R): R
actual open fun <R> foldIn(initial: R, operation: (R, Modifier.Element) -> R): R
Link copied to clipboard
expect fun Modifier.height(height: Dp): Modifier
expect fun Modifier.height(intrinsicSize: IntrinsicSize): Modifier
actual fun Modifier.height(height: Dp): Modifier
actual fun Modifier.height(intrinsicSize: IntrinsicSize): Modifier
actual fun Modifier.height(height: Dp): Modifier
actual fun Modifier.height(intrinsicSize: IntrinsicSize): Modifier
Link copied to clipboard
expect fun Modifier.heightIn(min: Dp = Dp.Unspecified, max: Dp = Dp.Unspecified): Modifier
actual fun Modifier.heightIn(min: Dp, max: Dp): Modifier
actual fun Modifier.heightIn(min: Dp, max: Dp): Modifier
Link copied to clipboard
expect fun Modifier.hidden(): Modifier
actual fun Modifier.hidden(): Modifier
actual fun Modifier.hidden(): Modifier
Link copied to clipboard

For consistency on different platforms, components such as HorizontalScrollContainer, HorizontalScrollBox, HorizontalScrollRow are recommended over this modifier.

Link copied to clipboard

This delegates to the CSS padding property on JS DOM and adds the padding inside. For consistency on different platforms, please use it as the last modifier after the other modifiers such as background and clickable. See the KDoc of the padding overload with one Dp parameter for more information.

expect fun Modifier.innerPadding(paddingValues: PaddingValues): Modifier
expect fun Modifier.innerPadding(horizontal: Dp = 0.dp, vertical: Dp = 0.dp): Modifier
expect fun Modifier.innerPadding(start: Dp = 0.dp, top: Dp = 0.dp, end: Dp = 0.dp, bottom: Dp = 0.dp): Modifier

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

actual fun Modifier.innerPadding(paddingValues: PaddingValues): Modifier
actual fun Modifier.innerPadding(horizontal: Dp, vertical: Dp): Modifier
actual fun Modifier.innerPadding(start: Dp, top: Dp, end: Dp, bottom: Dp): Modifier
actual fun Modifier.innerPadding(paddingValues: PaddingValues): Modifier
actual fun Modifier.innerPadding(horizontal: Dp, vertical: Dp): Modifier
actual fun Modifier.innerPadding(start: Dp, top: Dp, end: Dp, bottom: Dp): Modifier
Link copied to clipboard

An alias for hidden.

Link copied to clipboard
actual fun Modifier.onClick(onClick: () -> Unit): Modifier
expect fun Modifier.onClick(onClick: () -> Unit): Modifier

Delegates to clickable on Android. onClick is not available on Android. See https://github.com/JetBrains/compose-multiplatform/issues/4468 for details.

actual fun Modifier.onClick(onClick: () -> Unit): Modifier
actual fun Modifier.onClick(onClick: () -> Unit): Modifier
Link copied to clipboard
expect fun Modifier.outerBorder(width: Dp, color: Color): Modifier

Follows the default CSS border behavior that is on the outside.

Follows the default CSS border behavior that is on the outside.

actual fun Modifier.outerBorder(width: Dp, color: Color): Modifier
actual fun Modifier.outerBorder(width: Dp, color: Color): Modifier
Link copied to clipboard

This delegates to the CSS margin property on JS DOM and adds the padding outside. For consistency on different platforms, please use it as the first modifier before the other modifiers such as background and clickable.

expect fun Modifier.outerPadding(paddingValues: PaddingValues): Modifier
expect fun Modifier.outerPadding(horizontal: Dp = 0.dp, vertical: Dp = 0.dp): Modifier
expect fun Modifier.outerPadding(start: Dp = 0.dp, top: Dp = 0.dp, end: Dp = 0.dp, bottom: Dp = 0.dp): Modifier

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

actual fun Modifier.outerPadding(paddingValues: PaddingValues): Modifier
actual fun Modifier.outerPadding(horizontal: Dp, vertical: Dp): Modifier
actual fun Modifier.outerPadding(start: Dp, top: Dp, end: Dp, bottom: Dp): Modifier
actual fun Modifier.outerPadding(paddingValues: PaddingValues): Modifier
actual fun Modifier.outerPadding(horizontal: Dp, vertical: Dp): Modifier
actual fun Modifier.outerPadding(start: Dp, top: Dp, end: Dp, bottom: Dp): Modifier
Link copied to clipboard
expect fun Modifier.padding(all: Dp): Modifier

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.

expect fun Modifier.padding(paddingValues: PaddingValues): Modifier
expect fun Modifier.padding(horizontal: Dp = 0.dp, vertical: Dp = 0.dp): Modifier
expect fun Modifier.padding(start: Dp = 0.dp, top: Dp = 0.dp, end: Dp = 0.dp, bottom: Dp = 0.dp): Modifier

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

actual fun Modifier.padding(all: Dp): Modifier
actual fun Modifier.padding(paddingValues: PaddingValues): Modifier
actual fun Modifier.padding(horizontal: Dp, vertical: Dp): Modifier
actual fun Modifier.padding(start: Dp, top: Dp, end: Dp, bottom: Dp): Modifier
actual fun Modifier.padding(all: Dp): Modifier
actual fun Modifier.padding(paddingValues: PaddingValues): Modifier
actual fun Modifier.padding(horizontal: Dp, vertical: Dp): Modifier
actual fun Modifier.padding(start: Dp, top: Dp, end: Dp, bottom: Dp): Modifier
Link copied to clipboard
open fun platformModify(block: Modifier.() -> Modifier): Modifier
open fun platformModify(block: Modifier.() -> Modifier): Modifier
Link copied to clipboard

An alias for hidden.

Link copied to clipboard
expect fun Modifier.rotate(degrees: Float): Modifier
actual fun Modifier.rotate(degrees: Float): Modifier
actual fun Modifier.rotate(degrees: Float): Modifier
Link copied to clipboard
expect fun Modifier.roundedCornerBackgroundAndOuterBorder(border: BorderStroke, cornerRadius: Dp, backgroundColor: Color): Modifier

The border is not on top of the background.

expect fun Modifier.roundedCornerBackgroundAndOuterBorder(border: BorderStroke, cornerRadiusPercent: Int, backgroundColor: Color): Modifier
expect fun Modifier.roundedCornerBackgroundAndOuterBorder(width: Dp, borderColor: Color, cornerRadius: Dp, backgroundColor: Color): Modifier
expect fun Modifier.roundedCornerBackgroundAndOuterBorder(width: Dp, borderColor: Color, cornerRadiusPercent: Int, backgroundColor: Color): Modifier
actual fun Modifier.roundedCornerBackgroundAndOuterBorder(border: BorderStroke, cornerRadius: Dp, backgroundColor: Color): Modifier
actual fun Modifier.roundedCornerBackgroundAndOuterBorder(border: BorderStroke, cornerRadiusPercent: Int, backgroundColor: Color): Modifier
actual fun Modifier.roundedCornerBackgroundAndOuterBorder(width: Dp, borderColor: Color, cornerRadius: Dp, backgroundColor: Color): Modifier
actual fun Modifier.roundedCornerBackgroundAndOuterBorder(width: Dp, borderColor: Color, cornerRadiusPercent: Int, backgroundColor: Color): Modifier
actual fun Modifier.roundedCornerBackgroundAndOuterBorder(border: BorderStroke, cornerRadius: Dp, backgroundColor: Color): Modifier
actual fun Modifier.roundedCornerBackgroundAndOuterBorder(border: BorderStroke, cornerRadiusPercent: Int, backgroundColor: Color): Modifier
actual fun Modifier.roundedCornerBackgroundAndOuterBorder(width: Dp, borderColor: Color, cornerRadius: Dp, backgroundColor: Color): Modifier
actual fun Modifier.roundedCornerBackgroundAndOuterBorder(width: Dp, borderColor: Color, cornerRadiusPercent: Int, backgroundColor: Color): Modifier
Link copied to clipboard
expect fun Modifier.roundedCornerOuterBorder(border: BorderStroke, borderRadius: Dp): Modifier
expect fun Modifier.roundedCornerOuterBorder(border: BorderStroke, borderRadiusPercent: Int): Modifier
expect fun Modifier.roundedCornerOuterBorder(width: Dp, color: Color, borderRadius: Dp): Modifier
expect fun Modifier.roundedCornerOuterBorder(width: Dp, color: Color, borderRadiusPercent: Int): Modifier
actual fun Modifier.roundedCornerOuterBorder(border: BorderStroke, borderRadius: Dp): Modifier
actual fun Modifier.roundedCornerOuterBorder(border: BorderStroke, borderRadiusPercent: Int): Modifier
actual fun Modifier.roundedCornerOuterBorder(width: Dp, color: Color, borderRadius: Dp): Modifier
actual fun Modifier.roundedCornerOuterBorder(width: Dp, color: Color, borderRadiusPercent: Int): Modifier
actual fun Modifier.roundedCornerOuterBorder(border: BorderStroke, borderRadius: Dp): Modifier
actual fun Modifier.roundedCornerOuterBorder(border: BorderStroke, borderRadiusPercent: Int): Modifier
actual fun Modifier.roundedCornerOuterBorder(width: Dp, color: Color, borderRadius: Dp): Modifier
actual fun Modifier.roundedCornerOuterBorder(width: Dp, color: Color, borderRadiusPercent: Int): Modifier
Link copied to clipboard
expect fun Modifier.size(dp: Dp): Modifier
expect fun Modifier.size(width: Dp, height: Dp): Modifier
actual fun Modifier.size(dp: Dp): Modifier
actual fun Modifier.size(width: Dp, height: Dp): Modifier
actual fun Modifier.size(dp: Dp): Modifier
actual fun Modifier.size(width: Dp, height: Dp): Modifier
Link copied to clipboard
expect fun Modifier.sizeIn(minWidth: Dp = Dp.Unspecified, minHeight: Dp = Dp.Unspecified, maxWidth: Dp = Dp.Unspecified, maxHeight: Dp = Dp.Unspecified): Modifier
actual fun Modifier.sizeIn(minWidth: Dp, minHeight: Dp, maxWidth: Dp, maxHeight: Dp): Modifier
actual fun Modifier.sizeIn(minWidth: Dp, minHeight: Dp, maxWidth: Dp, maxHeight: Dp): Modifier
Link copied to clipboard
expect open infix fun then(other: Modifier): Modifier
actual open infix fun then(other: Modifier): Modifier
actual open infix fun then(other: Modifier): Modifier
Link copied to clipboard
fun <A : AttrsScope<Element>> Modifier.toAttrs(finalHandler: A.() -> Unit? = null): A.() -> Unit
Link copied to clipboard
fun Modifier.toAttrsWithColor(color: Color?): AttrsScope<*>.() -> Unit
fun Modifier.toAttrsWithColor(color: ColorProducer?): AttrsScope<*>.() -> Unit
Link copied to clipboard

Note that if the component is a layout, for example a Material card, it applies to the target as a whole on Compose UI targets, but applies to its content on JS DOM. For consistency on different platforms, components such as VerticalScrollContainer, VerticalScrollBox, VerticalScrollColumn are recommended over this modifier.

Link copied to clipboard
expect fun Modifier.width(width: Dp): Modifier
expect fun Modifier.width(intrinsicSize: IntrinsicSize): Modifier
actual fun Modifier.width(width: Dp): Modifier
actual fun Modifier.width(intrinsicSize: IntrinsicSize): Modifier
actual fun Modifier.width(width: Dp): Modifier
actual fun Modifier.width(intrinsicSize: IntrinsicSize): Modifier
Link copied to clipboard
expect fun Modifier.widthIn(min: Dp = Dp.Unspecified, max: Dp = Dp.Unspecified): Modifier
actual fun Modifier.widthIn(min: Dp, max: Dp): Modifier
actual fun Modifier.widthIn(min: Dp, max: Dp): Modifier
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard