# Custom layouts

Read the docs below or view this video to learn more about activating the new lab UI and how to create custom layouts for your challenges.

{% embed url="<https://www.youtube.com/watch?v=32S86ZSp_aE>" %}

## What are Custom Layouts

Custom layouts allow you to customise the tab panels of a lab for an entire play, or customise the layout of each individual challenge for a more tailored experience.

<figure><img src="/files/FVrFOIGwK6xlQIkOonna" alt=""><figcaption><p>A lab set up with custom layouts.</p></figcaption></figure>

In the screen shot above, we show a lab with custom layouts enabled. Users entering the lab will all have this layout by default.

## How to configure custom layouts

{% tabs %}
{% tab title="Web" %}

1. You can create your custom layouts from the same `Layout & Theming` widget on the sidebar of a track dashboard.
2. Click the `Edit` button next to the `Layout` label.

<figure><img src="/files/AMoIyGhrXVSx6LHXrBG1" alt=""><figcaption><p>The Layout configuration page.</p></figcaption></figure>

**Choosing a layout for all challenges in your track.**

3. If you want to have the same, simple layout for your lab, simply enable on the `Use track layout for all challenges` toggle on the layout landing page. You now have useful default layouts that should easily fit most use cases.
4. Save changes, and you're done! Your lab should now be using the default layout for each of your challenges.

**Customising layouts for individual challenges.**

3. Select the challenge you want to customise and drag-and-drop tabs to your desired outcome.
4. Save your changes, and you're done! The challenge should now be reflecting the specific layout you have designed for the challenge.

You can customise each challenge to best fit your product and how you design your content.
{% endtab %}

{% tab title="CLI" %}
**Customise the layout for the whole track**

Open up your `track.yml` file, under the `lab_config` options you can configure the `default_layout` option, and toggle `override_challenge_layout` to true, configuring the layout for the entire lab.

```yaml
# track.yml
...
lab_config:
  theme:
    name: modern-dark
  override_challenge_layout: false
  default_layout: AssignmentLeft
...
```

**Layout API for lab\_config**

| Field                       | Options                                                    | Description                                                                                                                         |
| --------------------------- | ---------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------- |
| `theme.name`                | `modern-dark` or `original`                                | These two options are the only current themes available. A modern take on the Instruqt lab, and the classic original colour scheme. |
| `override_challenge_layout` | `true` or `false`                                          | Tells Instruqt to use the default track layout for your lab. And overrides any custom layouts you have enabled for any challenge.   |
| `default_layout`            | `AssignmentRight`, `AssignmentLeft`, or `AssignmentBottom` | Selects which default layout you would like to have for a track.                                                                    |

**Customise layout for an individual challenge**

You can also manage the individual, custom layouts as code, by adding a serialised string.

```yaml
# <challenge_slug>/assignment.md frontmatter block
...
lab_config:
  custom_layout: '{"root":{"children":[{"branch":{"children":[{"leaf":{"tabs":["assignment"],"activeTabId":"assignment","size":50}},{"leaf":{"tabs":["feedback"],"activeTabId":"feedback","size":50}}],"size":49}},{"leaf":{"tabs":["xpbbhgg2ilnm","vcly1o5zid56","jvcbfq9tblpa","zaw51ozikez1","dmyxy9cxga73"],"activeTabId":"xpbbhgg2ilnm","size":50}}],"orientation":"Horizontal"}}'
...

```

{% endtab %}
{% endtabs %}

## Themes

|            ModernDark            |             Original             |
| :------------------------------: | :------------------------------: |
| ![](/files/FVrFOIGwK6xlQIkOonna) | ![](/files/8cNtk6fDDwucWQiBRs2o) |

{% tabs %}
{% tab title="Web" %}

1. Enable `New Lab UI` for the track.
2. In the `Layout & Theming widget` select between the ModernDark theme and the Original colour scheme. \\

   <figure><img src="/files/R1THCnF1TJpxsSKpqm09" alt=""><figcaption></figcaption></figure>
3. The track will now use the selected theme for all plays.
   {% endtab %}

{% tab title="CLI" %}
Refer to the `How to configure layouts` and [check the API here](https://app.gitbook.com/o/-MGJDSkH2c9t7pyFLGTl/s/-MGJDYBXyftBAZb1Wq0e/~/changes/768/tracks/manage/custom-layouts-and-themes#layout-api-for-lab_config).
{% endtab %}
{% endtabs %}


---

# Agent Instructions: 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:

```
GET https://docs.instruqt.com/tracks/manage/custom-layouts.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
