Named Slot

Choose your OS:
On this page:

Description

This widget allows you to expose an external slot for your User Widget that can be populated with any other widgets and is useful for creating custom widget functionality.

Usage Example

Below we created a Widget Blueprint called ButtonTemplate and replaced the Canvas Panel with a Horizontal Box. Inside that Horizontal Box we placed a Button and Text widget and what we want is to allow the space next to the button to filled by someone else with whatever widgets they want or to be filled by us later from inside another Widget Blueprint.

NamedSlot1.png

We can do so by adding a Named Slot widget to the Horizontal Box.

NamedSlot2.png

In our example, for clarity, we have updated the name of the Named Slot, set it to Fill and adjusted the preview size. Also, to get the same size, select Custom from the Fill Size dropdown and change the Width to 400 and Height to 50.

NamedSlot3.png

We have also updated the text on the Button.

NamedSlot4.png

We Compiled and Saved, closed the ButtonTemplate, and then created a new Widget Blueprint.

In the new Widget Blueprint, under User Created, we drag our Button Template User Widget onto our Canvas Panel.

NamedSlot5.png

We can then add Widgets to the Named Slot, however we cannot drag-and-drop them onto the graph inside the Named Slot.

NamedSlot6.png

We need to use the Hierarchy to create a new root widget for the Named Slot.

NamedSlot7.png

We can now stylize the Widget added to the Named Slot however we wish.

NamedSlot8.png

In order to drag-and-drop Widgets onto the graph, we need a container that can hold Widgets (for example a Canvas Panel).

NamedSlot9.png

Above we have created another ButtonTemplate Widget, this one uses a Canvas Panel and we can now drag Widgets onto it.

You add multiple Widgets to the Named Slot, allowing you to setup templates that can be populated with various widgets.

NamedSlot10.png