DreamGUI
Reference

UDreamExpandableArea

A header that toggles, and the content it hides.

Inherits from UDreamUIControl.

Declared in Public/Controls/DreamExpandableArea.h.

A header that toggles, and the content it hides.

Three nodes and one behaviour: a column, a clickable header face with an indicator and a label on it, and a content column below. The header is a UUIButton on its own face, exactly as DreamButton builds one -- an expander IS a button whose click means "show the rest" -- so hover, press and navigation come from the library's one selectable rather than from a second interaction story.

HOW A CONSUMER PUTS CONTENT IN IT, and which idiom that is, because there are two in this codebase and only one is reachable from here:

Native.ExpandableArea Details {
    Label = "Advanced"
    Text Body { Text = "..." }
}

Nesting, plainly. The text builder attaches a node's children to the widget it just built (BuildNode's TrySetParent), so those widgets arrive as children of THIS control, sitting beside the tree the control realized for itself -- and the content column is this control's DEFAULT NAMED SLOT, so they are moved into it for free.

That used to be a hand-written adoption pass here, with a comment explaining that UDreamNamedSlot could not be used: a host's NamedSlotContent was hung by InitializeWidgetStatic, which returns immediately for a class with no widget-tree archetype, and a native control never has one -- so a slot declared here would have been a hole nothing could fill. That gate is gone (slots are now filled from UDreamUserWidget::Initialize, after NativeOnInitialized, which is the first moment BOTH kinds of contents exist), and with it the reason to hand-roll this. Code that assembles a hierarchy by hand can still call SetContent; the designer's drag into this control lands as a child, which is the same road as the .dui above.

THE PART NAMES, which a Template's author has to spell exactly, because parts are bound by DISPLAY NAME and nothing checks the spelling but the missing-part log line:

ExpandableArea   the outer column
HeaderFace       the clickable header face; the node whose height IS HeaderHeight
HeaderRow        the indicator-and-label row inside the face
Arrow            the glyph indicator          (optional)
ArrowMark        the image indicator          (optional)
Label            the stock header text
Header           the header HOLE -- a UDreamNamedSlot  (optional)
Content          the body, and this control's default UDreamNamedSlot

The face is "HeaderFace" and NOT "Header" on purpose. A named slot's name is its host node's display name (UDreamNamedSlot::GetSlotName), so the hole must be called Header -- that string is HeaderSlotName, a public binding key, and one of the two names GetNativeSlotNames promises. A part walk meets ancestors before descendants, so a face also called Header answers for BOTH, and the swap that puts the stock label away when the hole is filled then reads an empty hole and sleeps the entire header. A template that names its own header face Header re-creates exactly that: the header disappears, and the only trace is one missing-part line for HeaderFace.

UMG parity is UExpandableArea's core: bIsExpanded, SetIsExpanded, OnExpansionChanged -- plus the library's OnValueChangedBP, because the expanded flag is a value and <-> binds against it.

Collapsed, the control measures as the HEADER and nothing more: an Auto slot asks the control for its size, and an expander that kept its expanded height would leave a hole in every list it is in.

Properties

NameTypeCategoryIn the details panelFrom BlueprintDescription
StyleFDreamExpandableAreaStyleExpandable AreayesGetStyle / SetStyleThis instance's own look. The project sheet wins while StyleSource says so AND a sheet actually exists; with no sheet in the project this IS the look in effect -- which is why it stays editable instead of being gated on the enum: the old edit condition greyed the exact values that were driving the control.
LabelFTextExpandable AreayesGetLabel / SetLabelThe words on the header.
bIsExpandedboolExpandable AreayesGetIsExpanded / SetIsExpandedWhether the content shows. A property so .dui, the designer and bindings can see it and so an author can ship a section already open; every road that CHANGES it goes through SetIsExpanded, which is the only thing that broadcasts.
MaxHeightfloatExpandable AreayesGetMaxHeight / SetMaxHeightA ceiling on the CONTENT's share of the control's height, in local units -- UMG's MaxHeight.
ExpansionDurationfloatExpandable AreayesGetExpansionDuration / SetExpansionDurationHow long the open and close take, in seconds. Zero (the default) is instant.
RootNodeTObjectPtr<UDreamWidget>Expandable Area-read only
HeaderNodeTObjectPtr<UDreamWidget>Expandable Area-read onlyThe clickable face, and the node whose height IS the style's HeaderHeight. Bound from the part named "HeaderFace" -- the FIELD keeps its name, the part does not; see the class comment for why the two differ.
HeaderRowNodeTObjectPtr<UDreamWidget>Expandable Area-read onlyThe indicator-and-label row inside the header. See the tree comment for why it is its own node.
ArrowNodeTObjectPtr<UDreamWidget>Expandable Area-read onlyThe built-in glyph indicator. Asleep whenever the state's brush carries an image instead.
ArrowMarkNodeTObjectPtr<UDreamWidget>Expandable Area-read onlyThe image indicator, the glyph's stand-in. Exactly one of the two is awake.
LabelNodeTObjectPtr<UDreamWidget>Expandable Area-read only
ContentNodeTObjectPtr<UDreamWidget>Expandable Area-read onlyWhere a consumer's content lives, and the node that is switched off when collapsed.
HeaderBehaviourTObjectPtr<UUIButton>Expandable Area-read only
HeaderSlotNodeTObjectPtr<UDreamWidget>Expandable Area-read onlyThe header's hole, in the stock label's place. Empty is the normal state.

Functions

FunctionKindDescription
UDreamWidget* GetContent()pureThe first widget in the content column, or null while it is empty.
float GetExpansionDuration()pureGet Expansion Duration
bool GetIsExpanded()pureGet Is Expanded
FText GetLabel()pureGet Label
float GetMaxHeight()pureGet Max Height
FDreamExpandableAreaStyle GetStyle()pureGet Style
void SetContent(UDreamWidget* InContent)callablePut InContent in the content column, taking it from wherever it currently hangs.
void SetExpansionDuration(float InExpansionDuration)callableHow long the NEXT open or close takes. Nothing is re-run: a duration describes a move that has not happened yet, and replaying the current one to honour a new speed would animate a section the player already finished opening.
void SetIsExpanded(bool bInIsExpanded)callableSilent when the flag does not move; otherwise pushes the visuals and broadcasts both events.
void SetLabel(FText InLabel)callableThe words on the header, written through to the label the control owns.
void SetMaxHeight(float InMaxHeight)callableRe-measures at once: the ceiling is part of the height this control claims.
void SetStyle(FDreamExpandableAreaStyle InStyle)callableThis instance's whole look, replaced and pushed. See UDreamButton::SetStyle for the caveat.
void ToggleExpansion()callableWhat the header click does, callable without a pointer.

Events

EventSignatureDescription
OnExpansionChangedvoid DreamExpandableAreaExpansionChangedEvent__DelegateSignature(bool bIsExpanded)Fired whenever the expanded flag moves, from a click or from code.
OnValueChangedBPvoid DreamExpandableAreaExpansionChangedEvent__DelegateSignature(bool bIsExpanded)The <-> convention: two-way bindings synthesize their reverse route against this exact name, so a value control carries it alongside its spoken events. Fires with them.

Compared with UMG

Every Blueprint-facing member of the UMG class, and where it went. adopt: same name, same meaning. map: here under another name or on another type. reject: deliberately absent, with the reason.

UMGMemberStatusHereNote
UExpandableAreaStyleadoptStyleFDreamExpandableAreaStyle: the header's height, its five state colours, the label, and the content area's background and padding.
UExpandableAreaBorderBrushmapFDreamExpandableAreaStyle::ContentBackgroundA colour rather than an FSlateBrush: the content area is a procedural rect, and what an expander's frame is in this family is that rect's fill. A picture behind the content is a Native.Border around it.
UExpandableAreaBorderColormapFDreamExpandableAreaStyle::ContentBackgroundOne colour where UMG has a brush and a tint over it, for the reason above: there is no brush here for a second colour to multiply.
UExpandableAreabIsExpandedadoptbIsExpandedAuthored open or closed; every road that CHANGES it goes through SetIsExpanded, which is what broadcasts.
UExpandableAreaMaxHeightadoptMaxHeightZero is no ceiling, which is what this control has always done.
UExpandableAreaHeaderPaddingmapFDreamExpandableAreaStyle::HeaderPaddingIn the style, because how a project's section headers are inset is a theme decision.
UExpandableAreaAreaPaddingmapFDreamExpandableAreaStyle::ContentPaddingNamed for what it pads rather than for the widget it sits on.
UExpandableAreaOnExpansionChangedadoptOnExpansionChangedFires from a click and from code alike.
UExpandableAreaGetIsExpandedadoptGetIsExpanded
UExpandableAreaSetIsExpandedadoptSetIsExpanded
UExpandableAreaSetIsExpanded_AnimatedmapExpansionDurationA duration rather than a second function: whether an expander animates is a property of the expander, not of the caller, so every road (a click, a binding, code) gets the same open. Zero is instant, which is what every expander already authored does.
UExpandableAreaSetStyleadoptSetStyleUExpandableArea has no style setter at all (its Style is EditAnywhere only); this is the family's spelling of replacing a look at runtime.

On this page