WrapContentWidthModifier

An element that signals the component should fit its content horizontally.

Functions

Link copied to clipboard

Sets the horizontal alignment.

Sets the vertical alignment.

Sets both horizontal and vertical alignment.

Link copied to clipboard

Sets the background color.

Link copied to clipboard

Applies bold styling.

Link copied to clipboard
fun Modifier.border(style: BorderStyle, color: Color = Color.Default): Modifier

Adds a border with the specified style and color.

Link copied to clipboard
fun Modifier.fillMaxHeight(fraction: Float = 1.0f): Modifier

Requests to fill the available height, optionally by a fraction.

Link copied to clipboard
fun Modifier.fillMaxSize(fraction: Float = 1.0f): Modifier

Requests to fill all available space, optionally by a fraction.

Link copied to clipboard
fun Modifier.fillMaxWidth(fraction: Float = 1.0f): Modifier

Requests to fill the available width, optionally by a fraction.

Link copied to clipboard

Finds the last element of type T in the modifier chain.

Link copied to clipboard

Flattens the recursive Modifier chain into a linear list of elements.

Link copied to clipboard
open override fun <R> foldIn(initial: R, operation: (R, Modifier.Element) -> R): R

Accumulates a value by applying an operation to each element in the modifier chain, starting from the head (outermost) and moving towards the tail (innermost).

Link copied to clipboard
open override fun <R> foldOut(initial: R, operation: (Modifier.Element, R) -> R): R

Accumulates a value by applying an operation to each element in the modifier chain, starting from the tail (innermost) and moving towards the head (outermost).

Link copied to clipboard

Sets the foreground color.

Link copied to clipboard
fun Modifier.height(height: Int): Modifier

Constrains the height to a fixed height.

Link copied to clipboard

Applies italic styling.

Link copied to clipboard
fun Modifier.margin(all: Int): Modifier

Adds all characters of margin on all sides.

fun Modifier.margin(horizontal: Int = 0, vertical: Int = 0): Modifier

Adds horizontal and vertical margin.

fun Modifier.margin(left: Int = 0, right: Int = 0, top: Int = 0, bottom: Int = 0): Modifier

Adds margin for each side individually.

Link copied to clipboard
fun Modifier.offset(x: Int = 0, y: Int = 0): Modifier

Applies a relative x and y offset.

Link copied to clipboard
fun Modifier.padding(all: Int): Modifier

Adds all characters of padding on all sides.

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

Adds horizontal and vertical padding.

fun Modifier.padding(left: Int = 0, right: Int = 0, top: Int = 0, bottom: Int = 0): Modifier

Adds padding for each side individually.

Link copied to clipboard

Applies strikethrough styling.

Link copied to clipboard
open infix fun then(other: Modifier): Modifier

Chains this modifier with other.

Link copied to clipboard

Accumulates all MarginModifier elements in the chain into a single result.

Link copied to clipboard

Accumulates all OffsetModifier elements in the chain into a single result.

Link copied to clipboard

Accumulates all PaddingModifier elements in the chain into a single result.

Link copied to clipboard

Applies underline styling.

Link copied to clipboard
fun Modifier.weight(weight: Float): Modifier

Assigns a relative weight for layout distribution.

Link copied to clipboard
fun Modifier.width(width: Int): Modifier

Constrains the width to a fixed width.

Link copied to clipboard

Sets vertical sizing to fit content.

Link copied to clipboard

Sets both horizontal and vertical sizing to fit content.

Link copied to clipboard

Sets horizontal sizing to fit content.