LavaUI docs GitHub

struct Expand

Swift

struct Expand<Content> where Content : View

Disclosure control: chevron + title in a rounded outline, content below when open.

Matches the common “expand block” pattern (› header, bordered pill). Use it to gate continuous work — live charts, AnimationDriver widgets — so a long scroll is not paying redraws while the section is collapsed.

Sources/LavaUI/Expand.swift:82

Constructors

init(_ title: String, isExpanded: Binding<Bool>, style: ExpandStyle = ExpandStyle(), @ViewBuilder content: () -> Content)

Creates a disclosure.

  • title: The header text.
  • isExpanded: Whether the content shows; the header toggles it.
  • style: Colours and metrics; the default follows the theme.
  • content: What shows while expanded. It is not mounted while collapsed.

Sources/LavaUI/Expand.swift:98

Properties

var body: some View { get }

Not documented.

Sources/LavaUI/Expand.swift:110

var content: Content

What the disclosure shows while expanded.

Sources/LavaUI/Expand.swift:90

var isExpanded: Binding<Bool>

Whether the content is showing. Clicking the header toggles it.

Sources/LavaUI/Expand.swift:86

var style: ExpandStyle

Colours, chevrons, paddings and the reveal transition.

Sources/LavaUI/Expand.swift:88

var title: String

The header text, shown after the chevron.

Sources/LavaUI/Expand.swift:84