> ## Documentation Index
> Fetch the complete documentation index at: https://docs.subframe.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Props & slots

> Add data and composition to your components.

Properties make your components reusable by accepting different data. There are four types:

* **Text / Number** — Simple text or numeric values
* **Icon** — Icon selection from available icon libraries
* **Image** — Image URLs or uploaded files
* **Slot** — Regions for dynamic content and composition

When using component instances, properties can be configured in the inspector.

<Frame caption="Configuring properties of a Button component instance">
  <img src="https://mintcdn.com/subframe-59800133/E2DcgNWNaQUj3Q4q/images/components/component-props-example.png?fit=max&auto=format&n=E2DcgNWNaQUj3Q4q&q=85&s=601de262b1a3f75184d569b67257d2e7" alt="Showing properties of a component instance" width="310" height="281" data-path="images/components/component-props-example.png" />
</Frame>

Text, icon, and image props are for simple data. Slots are special properties that allow for composition—see [dedicated section](#slots) below.

## Creating a new property

1. Ensure you have nothing selected in design mode
2. On right-hand panel, click **Properties** > <Icon icon="plus" size={16} />
3. Select the property type to add

You can also create a property when [linking](/learn/components/props-and-slots#linking-element-contents-to-a-property) elements.

## Removing properties

1. Ensure you have nothing selected in design mode
2. Look for your property under **Properties**
3. Click on the <Icon icon="minus" size={16} /> to delete

## Linking element contents to a property

<Frame>
  <img src="https://mintcdn.com/subframe-59800133/E2DcgNWNaQUj3Q4q/images/components/linking-to-prop.png?fit=max&auto=format&n=E2DcgNWNaQUj3Q4q&q=85&s=8854e4b9c8e311231b5705043fdedbf8" alt="Linking element contents to a property" width="304" height="167" data-path="images/components/linking-to-prop.png" />
</Frame>

1. Click on the element
2. In inspector, click **Content** > <Icon icon="code" size={16} />
3. Select the property or **New Property...** to create a new one

## Slots

Slots expose a region of your component as a prop. They're useful for:

* **Reusability & composition** — Add dynamic content like elements and other components within others
* **Adding interactions in code** — Let developers add business logic within your components. See [adding interactive logic](/guides/component-docs) for more.

<Frame caption="Learn how slots work in Subframe.">
  <iframe style={{ width: "100%", height: "auto", aspectRatio: "16 / 9" }} src="https://www.youtube-nocookie.com/embed/7C9cRkvKbQY" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen />
</Frame>

#### Adding slots

1. Create a stack
2. In the inspector, click **Slot** > <Icon icon="plus" size={16} />
3. Name your slot, click **Create**

You can also right-click or press <kbd>/</kbd> to open [quick actions](/learn/design-mode/quick-actions), then select **Add slot**.

#### Using slots

<Frame>
  <img src="https://mintcdn.com/subframe-59800133/E2DcgNWNaQUj3Q4q/images/components/editing-slots.png?fit=max&auto=format&n=E2DcgNWNaQUj3Q4q&q=85&s=ad9681d0009a6afbfcb6740ed185e100" alt="Editing slots within a component instance" width="300" height="150" data-path="images/components/editing-slots.png" />
</Frame>

1. Insert a component instance
2. In inspector, look for the slot property and click **Edit X layers**

Within the canvas, you can also double-click any contents within a slot to edit.

#### Previewing slots

When viewing component docs, components in slots are exposed in the properties panel. You can edit these component props in the preview to test how your component handles different configurations.
