padding

Reserves all along every edge of the child. A decoration declared before a padding paints over the space it reserves as well, as paint outsets: background(brush).padding(8) fills the child and the space around it.

Return

this modifier with the padding declared on it.


context(scope: ConstrainedScope)
fun SwingModifier.padding(start: Int = 0, top: Int = 0, end: Int = 0, bottom: Int = 0): SwingModifier

Reserves start before the child and end after it along the reading order, and top and bottom above and below it, each edge left unreserved by default. start and end swap edges under a right-to-left reading order; see absolutePadding for a padding that never does.

A padding reserves space, so none of the four is ever below zero; declare offset to move a child outward from where its container places it.

Return

this modifier with the padding declared on it.


context(scope: ConstrainedScope)
fun SwingModifier.padding(horizontal: Int = 0, vertical: Int = 0): SwingModifier

Reserves horizontal before and after the child along the reading order, and vertical above and below it, either pair left unreserved by default.

Return

this modifier with the padding declared on it.