widthIn

fun Modifier.widthIn(min: Int = 0, max: Int = Int.MAX_VALUE): Modifier(source)

Constrains the width to an independently clamped inclusive range. A requested range disjoint from its parent range is pinned to the nearest parent boundary. Int.MAX_VALUE remains an unbounded maximum, and the new behavior is appended inside the existing modifier chain.

Return

this chain with one appended width-range modifier.

Parameters

min

the non-negative requested minimum width.

max

the requested maximum width.

Throws

when a value is negative or min exceeds max.