width
public fun Modifier.width(intrinsicSize: IntrinsicSize): Modifier
Declare the preferred width of the content to be the same as the min or max intrinsic width of the content. The incoming measurement Constraints may override this value, forcing the content to be either smaller or larger.
See height for options of sizing to intrinsic height. Also see width and widthIn for other options to set the preferred width.
Example usage for min intrinsic:
Example usage for max intrinsic:
width
public fun Modifier.width(width: Dp): Modifier
Declare the preferred width of the content to be exactly widthdp. The incoming measurement Constraints may override this value, forcing the content to be either smaller or larger.
For a modifier that sets the width of the content regardless of the incoming constraints see Modifier.requiredWidth. See height or size to set other preferred dimensions. See widthIn, heightIn or sizeIn to set a preferred size range.
Example usage: