# Default Slot

{% hint style="info" %}
Previous versions of Gum called this variable `Default Child Container`. This was changed to `Default Slot` in the February 2026 release.
{% endhint %}

Default Slot specifies where children are added to instances of the selected component.

By default this value is blank, which means that newly added children treat the entire component as their parent. If Default Slot value is set, children which are dropped on instances of this component type use the Default Slot as their parent.

Default Slot is typically set on containers which are designed to hold children, but which have margins or decoration around the dedicated container instance. Examples include list boxes, tree views, and frames.

{% hint style="info" %}
The Default Slot property simplifies the addition of new children to a container. Changing this value will not change already-added children. This property is not required, since the Parent can be manually typed and set to the inner container using the "dot". See below for more information on dot assignments.
{% endhint %}

Multiple instances can act as slots. For information on using multiple slots, see the [Is Slot](https://docs.flatredball.com/gum/gum-tool/gum-elements/general-properties/is-slot) page.

### Example

Consider a Component named Frame which has two instances: OuterRectangle and InnerRectangle.

<figure><img src="https://2695663588-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M_fzQmxQ1VeUFHcoo2c%2Fuploads%2Fgit-blob-745c456286e5f4f249a5c67841719023edd8f85c%2Fimage%20(1)%20(1)%20(3).png?alt=media" alt=""><figcaption><p>Frame component with two children</p></figcaption></figure>

This Component is designed to keep all of is children inside the InnerRectangle, so that any child automatically respects the margin specified by InnerRectangle.

To make this kind of relationship the default, the Frame can set its Default Slot property to InnerRectangle.

<figure><img src="https://2695663588-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M_fzQmxQ1VeUFHcoo2c%2Fuploads%2FIJPcSBEdh88o3RDZFodr%2F23_05%2010%2035.png?alt=media&#x26;token=a71cb313-c829-44db-8d0e-f74b3f3eb800" alt=""><figcaption><p>Setting the Default Child Container</p></figcaption></figure>

Once this value is set, instances which are drag+dropped onto Frame instances use the InnerRectangle as their parent, as shown in the following animation.

<figure><img src="https://2695663588-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M_fzQmxQ1VeUFHcoo2c%2Fuploads%2Fgit-blob-3203cc0ccabd5c6faa546786d1dd27d59409dbb7%2F11_20%2005%2009.gif?alt=media" alt=""><figcaption><p>Adding a child automatically uses the Default Child Container</p></figcaption></figure>

### Parent Details

When one instance is drag+dropped onto another instance, the Parent property is set according to the parent's Default Slot.

Using the example above, the RectangleInstance is dropped on the ContainerTestInstance. Since the ContainerTestInstance is of type Frame, then the Default Slot is applied on the drop, which results in the RectangleInstance's Parent being set to `ContainerTestInstance.InnerRectangle`.

<figure><img src="https://2695663588-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M_fzQmxQ1VeUFHcoo2c%2Fuploads%2FHCTx3zoOJkREUg7dOPwM%2F02_08%2043%2000.png?alt=media&#x26;token=d6807094-0b35-4ab9-a9af-8528ac8bba54" alt=""><figcaption></figcaption></figure>

## Ignoring Default Slot

As mentioned above, if an instance is added to a parent component, the instance automatically attaches itself to the parent's `Default Slot`. This can be undone by manually changing the `Parent` property.

For example, the `Parent` can be manually changed to `ContainerTestInstance`.

<figure><img src="https://2695663588-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M_fzQmxQ1VeUFHcoo2c%2Fuploads%2Fgit-blob-ba86dfbd3344105ed9833c1812553ade166a2e56%2F22_11%2038%2045.gif?alt=media" alt=""><figcaption><p>Changing the Parent to the name of the instance can force a child to be attached to the root of the parent</p></figcaption></figure>
