Skip to content

You are viewing documentation for Instruqt 2.0 Labs. For Tracks documentation, please visit docs.instruqt.com.

Defined inlayouts.hcl

The layout resource defines the visual structure of the lab UI through columns and rows. Layouts organize how tabs (terminal, service, editor, etc.) and instructions are displayed to users.

As a lab author, you use layouts to create optimal learning interfaces:

  • Content Organization: Structure the lab interface to present instructions alongside relevant tools and terminals in a logical arrangement
  • Multi-Tool Scenarios: Create layouts that support complex scenarios requiring multiple terminals, editors, or service interfaces simultaneously
  • Screen Real Estate Management: Optimize the use of available screen space to maximize both instruction visibility and hands-on tool access

Layouts ensure that the lab interface supports rather than hinders the learning experience by presenting information and tools effectively.

resource "layout" "name" {
column {
instructions {}
}
column {
tab "terminal" {
target = resource.terminal.main
}
}
}
resource "layout" "name" {
column {
width = "percentage"
tab "name" {
target = resource.type.name
title = "Display Title"
active = true
visible = true
closeable = false
movable = false
}
instructions {
title = "Instructions"
active = false
}
row {
height = "percentage"
# nested content
}
}
}

Fields

FieldTypeRequiredDescription
columnblock—Top-level columns in the layoutrepeatable

Column

layout→Column

Top-level columns in the layout

FieldTypeRequiredDescription
widthstring—Set the width of this column, as a bare integer without a unit: '50', not '50%'. Columns without an explicit width share the remaining space equally.
tabblock—Tabs within this columnrepeatable
instructionsblock—Instructions panel within this column
rowblock—Rows nested within this columnrepeatable

Tab

layout→Column→Tab

Tabs within this column

FieldTypeRequiredDescription
sluglabel—The unique identifier for this tab, used to reference it in HCL configuration and from other resources
titlestring—Display title for the tab
targetreferenceterminal, service, editor, note, virtual_browser, external_website, cloud_credentials✓Reference to the target resource
activebool—Set this tab as the active (focused) tab when the lab loads
visiblebool—Control whether this tab is visible to learners. Hidden tabs still exist but cannot be accessed.
closeablebool—Allow learners to close this tab
movablebool—Allow learners to drag and reposition this tab within the layout

Instructions

layout→Column→Instructions

Instructions panel within this column

FieldTypeRequiredDescription
titlestring—Title for the instructions panel
activebool—Whether the instructions panel is active
visiblebool—Whether the instructions panel is visible
closeablebool—Whether the instructions panel can be closed
movablebool—Whether the instructions panel can be moved

Row

layout→Column→Row

Rows nested within this column

FieldTypeRequiredDescription
heightstring—Set the height of this row, as a bare integer without a unit: '50', not '50%'. Rows without an explicit height share the remaining space equally.
tabblock—Tabs within this rowrepeatable
instructionsblock—Instructions panel within this row
columnblock—Columns nested within this row (3rd level)repeatable
Tab

layout→Column→Row→Tab

Tabs within this row

FieldTypeRequiredDescription
sluglabel—The unique identifier for this tab, used to reference it in HCL configuration and from other resources
titlestring—Display title for the tab
targetreferenceterminal, service, editor, note, virtual_browser, external_website, cloud_credentials✓Reference to the target resource
activebool—Set this tab as the active (focused) tab when the lab loads
visiblebool—Control whether this tab is visible to learners. Hidden tabs still exist but cannot be accessed.
closeablebool—Allow learners to close this tab
movablebool—Allow learners to drag and reposition this tab within the layout
Instructions

layout→Column→Row→Instructions

Instructions panel within this row

FieldTypeRequiredDescription
titlestring—Title for the instructions panel
activebool—Whether the instructions panel is active
visiblebool—Whether the instructions panel is visible
closeablebool—Whether the instructions panel can be closed
movablebool—Whether the instructions panel can be moved
Column

layout→Column→Row→Column

Columns nested within this row (3rd level)

FieldTypeRequiredDescription
widthstring—Set the width of this column, as a bare integer without a unit: '50', not '50%'. Columns without an explicit width share the remaining space equally.
tabblock—Tabs within this nested columnrepeatable
instructionsblock—Instructions panel within this nested column
Tab

layout→Column→Row→Column→Tab

Tabs within this nested column

FieldTypeRequiredDescription
sluglabel—The unique identifier for this tab, used to reference it in HCL configuration and from other resources
titlestring—Display title for the tab
targetreferenceterminal, service, editor, note, virtual_browser, external_website, cloud_credentials✓Reference to the target resource
activebool—Set this tab as the active (focused) tab when the lab loads
visiblebool—Control whether this tab is visible to learners. Hidden tabs still exist but cannot be accessed.
closeablebool—Allow learners to close this tab
movablebool—Allow learners to drag and reposition this tab within the layout
Instructions

layout→Column→Row→Column→Instructions

Instructions panel within this nested column

FieldTypeRequiredDescription
titlestring—Title for the instructions panel
activebool—Whether the instructions panel is active
visiblebool—Whether the instructions panel is visible
closeablebool—Whether the instructions panel can be closed
movablebool—Whether the instructions panel can be moved

The layout resource uses a hierarchical structure:

  • Columns: Vertical divisions of the layout
  • Rows: Horizontal divisions within columns
  • Tabs: Content panels that reference other resources
  • Instructions: Special panel for lab instructions

layout → column

A column is a vertical panel within the layout. Columns do not have names or IDs - they are anonymous blocks.

FieldRequiredTypeDescription
widthstringWidth of the column as a percentage (e.g., “50”, “33”). Defaults to equal distribution.
tabblockTab blocks defining content panels
instructionsblockInstructions panel configuration
rowblockNested row blocks for further subdivision

layout → column → row

A row is a horizontal panel within a column. Like columns, rows are anonymous blocks without names or IDs.

FieldRequiredTypeDescription
heightstringHeight of the row as a percentage. Defaults to equal distribution.
tabblockTab blocks defining content panels
instructionsblockInstructions panel configuration
columnblockNested column blocks for further subdivision

layout → tab

Tabs define the actual content panels within the layout. Each tab must have a name (used as a label) and references a resource.

FieldRequiredTypeDescription
name✓labelThe identifier for the tab, written as the block label: tab “name” { … }. Validator errors refer to it as the tab’s slug.
titlestringDisplay title for the tab. Defaults to capitalized name.
target✓reference to terminal, service, editor, external_website, virtual_browser, note, cloud_credentialsReference to the resource to display
activeboolWhether the tab is initially active. Defaults to false.
visibleboolWhether the tab is visible. Defaults to true.
closeableboolWhether users can close the tab. Defaults to false.
movableboolWhether users can move the tab. Defaults to false.
Resource TypeDescriptionReference
terminalInteractive command-line interfaceTerminal
serviceWeb applications and servicesService
editorCode editing environmentEditor
external_websiteExternal website integrationExternal Website
virtual_browserEmbedded virtual browserWeb Browser
noteReference materials and documentationNote
cloud_credentialsCloud provider credentials displayCloud Credentials

layout → instructions

The instructions block configures the special instructions panel.

FieldRequiredTypeDescription
titlestringTitle of the instructions tab. Defaults to “Instructions”.
activeboolWhether the tab is initially active. Defaults to false.
visibleboolWhether the tab is visible. Defaults to true.
closeableboolWhether users can close the tab. Defaults to false.
movableboolWhether users can move the tab. Defaults to false.
resource "layout" "two_column" {
column {
width = "50"
instructions {}
}
column {
width = "50"
tab "terminal" {
target = resource.terminal.main
}
}
}
resource "layout" "complex" {
column {
width = "40"
instructions {}
}
column {
width = "60"
row {
height = "70"
tab "terminal" {
target = resource.terminal.main
active = true
}
tab "editor" {
target = resource.editor.code
}
}
row {
height = "30"
tab "service" {
target = resource.service.web
}
}
}
}
resource "layout" "three_column" {
column {
width = "25"
instructions {}
}
column {
width = "50"
tab "terminal" {
target = resource.terminal.main
active = true
}
tab "terminal2" {
target = resource.terminal.secondary
}
}
column {
width = "25"
tab "notes" {
target = resource.note.hints
}
}
}
resource "layout" "nested" {
column {
width = "30"
row {
height = "50"
instructions {}
}
row {
height = "50"
tab "notes" {
target = resource.note.hints
}
}
}
column {
width = "70"
row {
height = "60"
column {
width = "60"
tab "terminal" {
target = resource.terminal.main
}
}
column {
width = "40"
tab "editor" {
target = resource.editor.config
}
}
}
row {
height = "40"
tab "service" {
target = resource.service.app
}
}
}
}

Breaking Change: The layout format has changed significantly from earlier versions:

  • Old format: Layout resources defined columns with IDs, tabs were configured separately in the lab resource referencing these column IDs
  • New format: Layout resources define columns with tabs inline, no separate tab configuration needed

If migrating from the old format:

layouts.hcl
## OLD (no longer valid)
resource "layout" "two_column" {
column "terminal" {}
column "instructions" {
width = "33"
}
}
# main.hcl
resource "lab" "example" {
layout "two_column" {
reference = resource.layout.two_column
tab "terminal" {
panel = "terminal" # References column ID
target = resource.terminal.shell
}
instructions {
panel = "instructions" # References column ID
}
}
}
## NEW (current format)
resource "layout" "two_column" {
column {
tab "terminal" {
target = resource.terminal.shell
}
}
column {
width = "33"
instructions {}
}
}
resource "lab" "example" {
layout = resource.layout.two_column
}
  1. Start Simple: Begin with a two-column layout (instructions + terminal)
  2. Responsive Design: Consider how your layout will appear on different screen sizes
  3. Tab Organization: Group related tabs in the same column/row
  4. Active Tabs: Set one tab per column/row as active for better UX
  5. Avoid Deep Nesting: Limit nesting to 2-3 levels for maintainability