> For the complete documentation index, see [llms.txt](https://cardstock-studio.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://cardstock-studio.gitbook.io/docs/design/prefabs.md).

# Prefabs

<mark style="color:$success;">**Prefabs**</mark> are a powerful way to reuse content multiple areas while retaining a single source of truth, where a change on the "Prefab" will update all Templates, Decks, and Books which use it. Instances of the Prefab can be overridden, retaining shared content while overriding specific values as needed, such as changing a color, or toggling layers in the prefab on or off.

***

## Create a Prefab

Right click any Layer that you want to turn into a Prefab, and choose "Create Prefab". This should be done after you've set up the Layer and children how you'd like — though you can update it later.

***

## Use a Prefab

In a Template or Book, click the "Add Layer" button, and choose "Prefabs", then the Prefab you'd like to add.

<figure><picture><source srcset="/files/7v2u5MLii9tJqGGYVjYV" media="(prefers-color-scheme: dark)"><img src="https://2449056524-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FK6BdQXak9wiY4BdSf9Rq%2Fuploads%2FuQxpxqDuibR3iK44S6nH%2FScreenshot%202026-06-08%20at%207.57.27%E2%80%AFPM.png?alt=media&amp;token=bb3dfd0e-f03c-4921-8eba-4e7a9f75713c" alt="" width="372"></picture><figcaption></figcaption></figure>

In your Layer stack, the Prefab will have a "\[PREFAB]" label on the right indicating it is a Prefab. The main "Prefab" layer is a placeholder, while the content IN the Prefab is a child of that.

{% hint style="info" %}
You can link prefab component values to a Variable, or use with Conditionals. However, making a Layer into a Prefab will strip those from the Prefab object itself, since other Tempaltes and use cases will not have the same Variables and Conditionals set up.
{% endhint %}

***

## Overriding Values

Any change to any Layer or paremeter in the Components is an "Override". These changes will persist even when the Prefab is updated.

***

## Applying Overrides

You can apply overrides to the prefab itself — doing so will affect all uses of the Prefabs in any other Template or Book.

<figure><picture><source srcset="/files/xrkz4MIkhyoMZkClOh6F" media="(prefers-color-scheme: dark)"><img src="https://2449056524-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FK6BdQXak9wiY4BdSf9Rq%2Fuploads%2FtlLlvmC9NW3vDogd6EXT%2FScreenshot%202026-06-08%20at%208.00.52%E2%80%AFPM.png?alt=media&amp;token=70791f7c-74b8-402f-894f-a8ce017ec803" alt="" width="375"></picture><figcaption></figcaption></figure>

To do this, select the "\[PREFAB]" layer. If changes have been made, you'll see information about that with the option to "Revert" or "Apply Overrides".

Reverting will remove the changes you've implemented. Otherwise, you can Apply Overrides to set your changes to all instances of the Prefab.

***

## Editing Prefabs

Click the "Prefabs" button in the top menu, and select the prefab you'd like to edit.

<figure><picture><source srcset="/files/kS8TRJf8KaKNkGjXhu1a" media="(prefers-color-scheme: dark)"><img src="https://2449056524-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FK6BdQXak9wiY4BdSf9Rq%2Fuploads%2F9OTkqxthcUOM5lzINkoW%2FScreenshot%202026-06-08%20at%208.04.00%E2%80%AFPM.png?alt=media&amp;token=85c7ce16-a709-4002-9cf7-b89f0615219c" alt=""></picture><figcaption></figcaption></figure>

The Prefab view is similar to a Template, but without the card background. Add new Layers & Components, or make any adjustments. Any changes will be represented in all instnaces of the Prefab which aren't overriding the values.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://cardstock-studio.gitbook.io/docs/design/prefabs.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
