LavaUI docs GitHub

struct ViewStyle

Swift

struct ViewStyle

Style a modifier pushes onto a node.

Every field is optional and merging is per field: whole-struct replacement would let the last modifier in a chain silently clear the others, which the spike caught before it could become a bug report.

Sources/LavaUI/Modifiers.swift:57

Constructors

init()

Creates a style that sets nothing.

Sources/LavaUI/Modifiers.swift:126

Properties

var backdropAdaptation: Float?

How far a bright backdrop is pulled toward light grey under the frost, 0…1. nil = full strength. See View.backdropBlur(radius:adaptation:).

Sources/LavaUI/Modifiers.swift:90

var backdropBlurRadius: Float?

Backdrop blur radius in pixels under this node's rect. nil = off. Emits BeginBackdropBlur / EndBackdropBlur around the node's paint so earlier UI is frosted and this node's fill + children stay sharp.

Sources/LavaUI/Modifiers.swift:87

var border: BorderStyle?

Stroke on this node's edge, drawn over its children. See View.border(_:width:).

Sources/LavaUI/Modifiers.swift:107

var clipsContent: Bool?

Scissor paint to this node's layout rect (SwiftUI .clipped()).

Sources/LavaUI/Modifiers.swift:97

var contentBlurRadius: Float?

Content blur radius in pixels. nil = off. Blurs this node's own paint, the way SwiftUI's .blur() does, rather than what is behind it.

Sources/LavaUI/Modifiers.swift:93

var cornerRadius: Float?

Corner radius of the background, hover fill and border, in points.

Sources/LavaUI/Modifiers.swift:71

var cursor: CursorShape?

Pointer image over this view. nil inherits. See View.cursor(_:).

Sources/LavaUI/Modifiers.swift:102

var fill: Color?

Flat background colour.

Sources/LavaUI/Modifiers.swift:61

var fillGradient: Gradient?

A two-stop linear fill, which wins over fill when both are set.

Separate rather than making fill an enum: fill is read in a dozen places that only ever want a flat colour, and widening it would make every one of them handle a case it has no use for.

Sources/LavaUI/Modifiers.swift:67

var flexGrow: Float?

Share of the parent's leftover main-axis space the box takes.

Sources/LavaUI/Modifiers.swift:81

var flexShrink: Float?

How much the box gives up when the parent's main axis overflows; 0 never shrinks.

Sources/LavaUI/Modifiers.swift:83

var frameAlignment: Alignment?

Where content sits inside a frame bigger than it — see View.frame(width:height:minWidth:minHeight:alignment:).

Unlike every other field here, this one changes the shape of the tree rather than a property of one node: content can only be placed inside a box if there is a box distinct from the content, so a frame that states an alignment always wraps. nil means the frame was never asked the question, which is not the same as being asked and answered .center.

Sources/LavaUI/Modifiers.swift:117

var glass: GlassEffect?

Glass on this node's own paint. nil = off. See View.glassEffect.

Sources/LavaUI/Modifiers.swift:95

var height: Dimension?

Height of the box.

Sources/LavaUI/Modifiers.swift:75

var hoverFill: Color?

Fill drawn over the background while the pointer is over the node.

Sources/LavaUI/Modifiers.swift:69

var hoverRegion: HoverRegionAction?

Sources/LavaUI/Modifiers.swift:119

var hoverSnap: Bool?

Snap hover off rather than ease it. See View.hoverSnap(_:).

Sources/LavaUI/Modifiers.swift:104

var isHidden: Bool?

Take this subtree out of layout and drawing without unmounting it. nil = visible. See View.hidden(_:).

Sources/LavaUI/Modifiers.swift:100

var minHeight: Float?

Smallest height layout may give the box, in points.

Sources/LavaUI/Modifiers.swift:79

var minWidth: Float?

Smallest width layout may give the box, in points.

Sources/LavaUI/Modifiers.swift:77

var padding: EdgeInsets?

Per-edge inset. nil means "leave the node's baseline alone".

Sources/LavaUI/Modifiers.swift:59

var tooltip: String?

Sources/LavaUI/Modifiers.swift:121

var tooltipPlacement: TooltipPlacement?

Which side of the view the tooltip goes. See TooltipPlacement.

Sources/LavaUI/Modifiers.swift:123

var width: Dimension?

Width of the box.

Sources/LavaUI/Modifiers.swift:73