LavaUI docs GitHub

struct ModifiedView

Swift

struct ModifiedView<Content> where Content : View

A view wearing a style.

The style lands on the content's existing node whenever that content is a single box, so .padding().background().cornerRadius() costs no extra Yoga nodes. Only a fragment — a TupleView, ForEach or conditional, which has no single node to style — materialises a wrapper.

Modifier order is preserved where it changes layout: padding applied after an existing modifier materialises one outer box. Paint-only modifiers on the same side of that boundary still collapse, avoiding SwiftUI's cost of a wrapper for every modifier.

Sources/LavaUI/Modifiers.swift:179

Constructors

init(content: Content, style: ViewStyle, forceWrapper: Bool = false)

Wraps content with style. Usually created by a modifier such as .padding(_:).

Sources/LavaUI/Modifiers.swift:191

Properties

var content: Content

The view being styled.

Sources/LavaUI/Modifiers.swift:181

var dumpDetail: String { get }

Not documented.

Sources/LavaUI/Modifiers.swift:197

var style: ViewStyle

The style fields this modifier sets; unset fields leave the view's own.

Sources/LavaUI/Modifiers.swift:183

Methods

func backdropBlur(radius: Float = 8, adaptation: Float = 1) -> ModifiedView<Content>

Sources/LavaUI/Modifiers.swift:890

func background(_ color: Color) -> ModifiedView<Content>

See View.background(_:).

Sources/LavaUI/Modifiers.swift:808

func background(_ gradient: Gradient) -> ModifiedView<Content>

See View.background(_:).

Sources/LavaUI/Modifiers.swift:813

func blur(radius: Float = 8) -> ModifiedView<Content>

Sources/LavaUI/Modifiers.swift:885

func border(_ color: Color, width: Float = 1) -> ModifiedView<Content>

Sources/LavaUI/Modifiers.swift:833

func clipped() -> ModifiedView<Content>

Sources/LavaUI/Modifiers.swift:838

func cornerRadius(_ radius: Float) -> ModifiedView<Content>

Sources/LavaUI/Modifiers.swift:828

func cursor(_ shape: CursorShape?) -> ModifiedView<Content>

Sources/LavaUI/Modifiers.swift:848

func flexGrow(_ value: Float = 1) -> ModifiedView<Content>

Sources/LavaUI/Modifiers.swift:875

func flexShrink(_ value: Float) -> ModifiedView<Content>

Sources/LavaUI/Modifiers.swift:880

func frame(width: Dimension? = nil, height: Dimension? = nil, minWidth: Float? = nil, minHeight: Float? = nil, alignment: Alignment? = nil) -> ModifiedView<Content>

Sources/LavaUI/Modifiers.swift:853

func glassEffect(refraction: Float = 20, rim: Float = 1, frost: Float = 0, magnification: Float = 1) -> ModifiedView<Content>

Sources/LavaUI/Modifiers.swift:900

func hidden(_ isHidden: Bool = true) -> ModifiedView<Content>

Sources/LavaUI/Modifiers.swift:843

func hoverBackground(_ color: Color) -> ModifiedView<Content>

Sources/LavaUI/Modifiers.swift:818

func hoverSnap(_ snap: Bool = true) -> ModifiedView<Content>

Sources/LavaUI/Modifiers.swift:823

func mountPrimitive() -> any AnyViewNode

Not documented.

Sources/LavaUI/Modifiers.swift:206

func onHover(_ action: @escaping (Bool) -> Void) -> ModifiedView<Content>

Sources/LavaUI/HoverRegion.swift:37

func padding(_ amount: Float) -> ModifiedView<ModifiedView<Content>>

Padding after an existing modifier belongs to a distinct outer box. This preserves the SwiftUI distinction between .padding().frame(...) and .frame(...).padding().

Sources/LavaUI/Modifiers.swift:789

func padding(_ edges: Edge, _ amount: Float) -> ModifiedView<ModifiedView<Content>>

See View.padding(_:_:). After another modifier, adds a box outside it.

Sources/LavaUI/Modifiers.swift:794

func padding(_ insets: EdgeInsets) -> ModifiedView<ModifiedView<Content>>

See View.padding(_:). After another modifier, adds a box outside it.

Sources/LavaUI/Modifiers.swift:799

func reconcilePrimitive(_ node: any AnyViewNode) -> any AnyViewNode

Not documented.

Sources/LavaUI/Modifiers.swift:210

func structureLines(indent: Int = 0) -> [String]

Not documented.

Sources/LavaUI/Modifiers.swift:199

func tooltip(_ text: String, placement: TooltipPlacement = .below) -> ModifiedView<Content>

Sources/LavaUI/Tooltip.swift:57