> For the complete documentation index, see [llms.txt](https://docs.webstudio.is/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.webstudio.is/university/foundations/reusability.md).

# Reusability & maintainability

Webstudio provides several tools that let you build sites that are easy to update and scale. Instead of making the same change in dozens of places, you can centralize content, styles, and structure so that editing one thing updates everywhere.

## Slots — shared structure across pages

<figure><picture><source srcset="https://330243581-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTep4EGj6hSC54ozHujyK%2Fuploads%2Fgit-blob-6efe73af8904218a64656a6aa9a1f29297194180%2Fslot-component-overview-dark.png?alt=media" media="(prefers-color-scheme: dark)"><img src="https://330243581-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTep4EGj6hSC54ozHujyK%2Fuploads%2Fgit-blob-5b98beea67e2ffeda2d266a952902f9c8871cf65%2Fslot-component-overview-light.png?alt=media" alt="Slot component in the Components panel with its help tooltip" width="280"></picture><figcaption><p>A Slot shares its content across its instances</p></figcaption></figure>

A [Slot](https://docs.webstudio.is/university/core-components/slot.md) is a component that references the content of another page. Any instance that uses that slot always renders the same content, so editing the source page updates every slot automatically.

**Common uses:**

* Navigation header and footer shared across all pages
* A cookie banner or chat widget added once and reused everywhere
* A 404 layout reused inside multiple dynamic page templates

To create a shared layout, build the header (or any repeating section) on one page, then add a Slot on every other page and point it at that source. You only maintain the design in one place.

{% hint style="info" %}
[CSS variables](https://docs.webstudio.is/university/foundations/css-variables.md) defined on a parent are accessible inside Slots. [Data variables](https://docs.webstudio.is/university/foundations/variables.md), however, are scoped to their page and are not available inside Slots.
{% endhint %}

→ [Slot component reference](https://docs.webstudio.is/university/core-components/slot.md)

## Design tokens & CSS variables — reusable styles

<figure><picture><source srcset="https://330243581-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTep4EGj6hSC54ozHujyK%2Fuploads%2Fgit-blob-d314fc36cde55e7b643d9a4fb26754f2afc88948%2Fh1-token-dark.png?alt=media" media="(prefers-color-scheme: dark)"><img src="https://330243581-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTep4EGj6hSC54ozHujyK%2Fuploads%2Fgit-blob-02caa7fe1743461cec6f9a501f6573083eb1c7f2%2Fh1-token-light.png?alt=media" alt="heading-1 design token applied in Style sources" width="240"></picture><figcaption><p>A token applied to an instance — styles update everywhere this token is used</p></figcaption></figure>

CSS variables and design tokens work together as two layers of reusability.

[**CSS variables**](https://docs.webstudio.is/university/foundations/css-variables.md) are the bottom layer — individual named values like colors, sizes, and spacing. Define `--color-brand` once, and use it in any style input across the entire site. When the brand color changes, update the variable in one place and every element referencing it updates.

<figure><picture><source srcset="https://330243581-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTep4EGj6hSC54ozHujyK%2Fuploads%2Fgit-blob-205732710a4962f6f90338a01c3ce885c4700996%2Fcss-var-example-dark.png?alt=media" media="(prefers-color-scheme: dark)"><img src="https://330243581-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTep4EGj6hSC54ozHujyK%2Fuploads%2Fgit-blob-a6f609c5e7c1cfe711740f528f7440f2a65e82f1%2Fcss-var-example-light.png?alt=media" alt="--gray-5 CSS variable defined in Advanced with a color value" width="240"></picture><figcaption><p>Define a CSS variable once, use it anywhere</p></figcaption></figure>

[**Design tokens**](https://docs.webstudio.is/university/foundations/design-tokens.md) are the next layer — named collections of styles that can be applied to any element, similar to CSS classes but without their common problems like combo classes, breakpoint conflicts, and accidental style inheritance. A `card` token might define padding, background, and border-radius. The values inside a token can reference CSS variables, giving you another level of reuse.

Together: CSS variables store the raw values, tokens package those variables into semantic, reusable style groups.

When you update a token — say, changing the padding defined on it — every element using that token updates automatically. Without tokens, you would make the same style change on every element individually.

**Common uses:**

* CSS variables: `--color-brand`, `--space-md`, `--radius-lg`
* Tokens: `button-primary`, `card`, `heading-lg` — each referencing those variables internally

→ [Design tokens](https://docs.webstudio.is/university/foundations/design-tokens.md) · [CSS variables](https://docs.webstudio.is/university/foundations/css-variables.md)

## Dynamic data — one template, many pages

### Static pages vs. dynamic pages

A **static page** is the full implementation of a design — layout, styles, and content all built directly on the canvas. The content is part of the page itself: you type the text, drop in the images, and publish. A home page, an about page, or a contact page are typically static.

A **dynamic page** is the design without the content. It has the same layout and structure as a static page, but instead of real text and images, its content comes from data — fetched at request time from an external source. The same template renders differently for every record: one URL loads a blog post, another loads a different one, using the exact same page design.

This is the key to scaling content-heavy sites. Instead of creating a separate page for every blog post, product, or team member, you build one dynamic page template and let the data do the rest.

<figure><img src="https://330243581-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTep4EGj6hSC54ozHujyK%2Fuploads%2Fgit-blob-e4534e5f14e219c0cc72bae7edbd8c2a0edad181%2Fright-and-wrong-way-collections.png?alt=media&amp;token=f5ede0b3-3120-476b-818b-e95bd140d5e0" alt="Comparison showing one template for all records vs. one page per record"><figcaption><p>One template renders all records — don't create a separate page for each</p></figcaption></figure>

→ [CMS & dynamic data](https://docs.webstudio.is/university/foundations/cms.md)

## Page templates — repeatable page creation

[Page templates](https://docs.webstudio.is/university/foundations/page-templates.md) let designers create reusable page blueprints inside a project. Unlike dynamic pages, which render many URLs from one live page and external data, page templates create independent regular pages.

Use page templates for repeatable static page types, such as service pages, campaign pages, landing pages, or client-created content pages that should start from a controlled structure.

## Why Webstudio is not a CMS

Webstudio is a **visual builder**, not a content management system. It does not have a built-in database for storing and managing hundreds of records.

This means:

* Creating one page per blog post is **not the right approach** for content-heavy sites. You would end up managing hundreds of pages inside the builder, with no structured editing workflow, no content relations, and no bulk operations.
* The right approach is to store that content in a dedicated CMS (WordPress, Directus, Baserow, Ghost, etc.) and connect it to a single dynamic page template in Webstudio via the [CMS integration](https://docs.webstudio.is/university/foundations/cms.md).

The builder is designed to be the **presentation layer** — responsible for layout, design, and how data is displayed — while the CMS is the **data layer** responsible for storing and editing content at scale.

{% hint style="info" %}
Webstudio dynamic pages use **one template for all records**. The CMS handles creating, editing, and organizing the actual records. Webstudio fetches and displays them.
{% endhint %}

## Summary

| Tool                                                                                                                                                                    | What it solves                                                  |
| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------- |
| [Slots](https://docs.webstudio.is/university/core-components/slot.md)                                                                                                   | Duplicate structure across pages — edit once, update everywhere |
| [CSS variables](https://docs.webstudio.is/university/foundations/css-variables.md) + [Design tokens](https://docs.webstudio.is/university/foundations/design-tokens.md) | Hard-coded style values scattered across elements               |
| [Dynamic data](https://docs.webstudio.is/university/foundations/cms.md)                                                                                                 | Building one page per content item instead of one template      |
| [Page templates](https://docs.webstudio.is/university/foundations/page-templates.md)                                                                                    | Recreating the same page structure manually                     |
| External CMS                                                                                                                                                            | Managing dozens or hundreds of records inside the builder       |

## Related

* [Slot](https://docs.webstudio.is/university/core-components/slot.md) – Shared components across pages
* [CSS variables](https://docs.webstudio.is/university/foundations/css-variables.md) – Individual named values (colors, sizes, spacing)
* [Design tokens](https://docs.webstudio.is/university/foundations/design-tokens.md) – Reusable style collections built on top of CSS variables
* [CMS & dynamic data](https://docs.webstudio.is/university/foundations/cms.md) – One template, many pages
* [Page templates](https://docs.webstudio.is/university/foundations/page-templates.md) – Reusable blueprints for creating pages
* [Variables](https://docs.webstudio.is/university/foundations/variables.md) – Binding data to the canvas


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.webstudio.is/university/foundations/reusability.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
