LavaUI docs GitHub

struct EdgeInsets

Swift

struct EdgeInsets

Per-edge inset around a view's content.

Used by .padding and stored on Yoga boxes as the source of truth for YGNodeStyleSetPadding on each edge. Prefer the static constructors over spelling four zeros by hand.

Sources/LavaUI/EdgeInsets.swift:39

Constructors

init(top: Float = 0, leading: Float = 0, bottom: Float = 0, trailing: Float = 0)

Creates insets from one value per edge, zero by default.

Sources/LavaUI/EdgeInsets.swift:50

init(_ edges: Edge, _ amount: Float)

Insets only the sides listed in edges; the rest stay zero.

Sources/LavaUI/EdgeInsets.swift:63

Properties

var bottom: Float

Inset from the bottom edge, in points.

Sources/LavaUI/EdgeInsets.swift:45

var horizontalTotal: Float { get }

Sum of leading and trailing — useful for width arithmetic.

Sources/LavaUI/EdgeInsets.swift:91

var leading: Float

Inset from the leading (left) edge, in points.

Sources/LavaUI/EdgeInsets.swift:43

var top: Float

Inset from the top edge, in points.

Sources/LavaUI/EdgeInsets.swift:41

var trailing: Float

Inset from the trailing (right) edge, in points.

Sources/LavaUI/EdgeInsets.swift:47

var verticalTotal: Float { get }

Sum of top and bottom — useful for height arithmetic.

Sources/LavaUI/EdgeInsets.swift:94

static let zero: EdgeInsets

No inset on any edge.

Sources/LavaUI/EdgeInsets.swift:73

Methods

static func all(_ value: Float) -> EdgeInsets

The same inset on all four edges.

Sources/LavaUI/EdgeInsets.swift:76

static func horizontal(_ value: Float) -> EdgeInsets

The same inset on the leading and trailing edges; top and bottom stay zero.

Sources/LavaUI/EdgeInsets.swift:81

static func vertical(_ value: Float) -> EdgeInsets

The same inset on the top and bottom edges; leading and trailing stay zero.

Sources/LavaUI/EdgeInsets.swift:86