> For the complete documentation index, see [llms.txt](https://docs.mosaic.js.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.mosaic.js.org/themes/extensions-and-themes.md).

# Parent theme system

## Create a parent theme

{% hint style="info" %}
**Theme** is a collection of components, which implements a presentation layer that is unique to your application. It should not contain any business logic. It should simply adopt extensions functionality to intended design of your application.
{% endhint %}

For application to be considered a theme, it must have a `package.json` field `mosaic.type` equal to `theme`

{% code title="package.json" %}

```javascript
{
    "mosaic": {
        "type": "theme",
        "themeAlias": "Parent"
    }
}
```

{% endcode %}

## Use a parent theme

Themes can stack on top of each other. A theme, which another theme is based on, is called a **parent theme**.&#x20;

To specify a parent theme, set the `package.json` field `mosaic.parentTheme` equal to intended parent theme's package name.

{% hint style="warning" %}
If you are selecting a new parent theme, it is not enough to just set the value of `mosaic.parentTheme`in `package.json`. The parent theme package should be listed among of your package's `dependencies`
{% endhint %}

The properly installed parent theme could look like this in `package.json`:

```javascript
{
    "name": "@me/child-theme",
    "dependencies": {
        "@example/parent-theme": "1.0.1"
    },
    "mosaic": {
        "type": "theme",
        "parentTheme": "@example/parent-theme"
    }
}
```

A theme can override files of a parent theme. Learn more about overriding a parent theme in the [File overrides](/themes/parent-themes.md#to-override-a-file-of-a-parent-theme) guide.


---

# 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://docs.mosaic.js.org/themes/extensions-and-themes.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.
