UI Layouts

Layouts are JSON documents that define how an entity type’s edit and view pages are structured: which fields appear in which sections, how tabs are organized, and where component blocks (assets panel, relationship graph, timeline, etc.) are placed.

Without a saved layout, StudioBrain auto-generates one from the template’s field list, so every entity type (including custom types) gets a working form and detail view. A saved layout gives you control over the page structure.

Where Layouts Live

EditionStorage
Self-hosted Core / desktopJSON files at _Templates/Layouts/{entity_type}.layout.json in the content root.
Cloud (SaaS)Rows in the project’s entity_layouts table (ProjectStore Durable Object). Template ingest does not seed a layout; layouts are saved from the Layout Designer. Read with GET /api/layouts and GET /api/layouts/{entity_type}.

Layout Structure

A layout is a JSON object with entity_type, version, sections, and optional tabs and view_config:

{
  "entity_type": "character",
  "version": "1.0",
  "sections": [
    {
      "id": "identity",
      "title": "Identity",
      "columns": 2,
      "fields": [
        { "key": "name", "label": "Name" },
        { "key": "species" },
        { "key": "faction" }
      ]
    },
    {
      "id": "portrait",
      "title": "Portrait",
      "component": "primary-image"
    },
    {
      "id": "assets",
      "title": "Assets",
      "component": "entity-assets"
    }
  ]
}

Sections

Each section is a visual block on the page. A section can contain fields, a component block, or both.

FieldTypeDescription
idstringUnique section identifier
titlestring or nullDisplay heading
iconstringOptional icon name
descriptionstringOptional helper text
columnsnumberNumber of field columns
collapsed_defaultbooleanWhether the section starts collapsed
fieldslistField objects; key is the template field name. Optional label, ui_component, column_span, rows, required, read_only, placeholder, help, options, group, and others
componentstringA component block ID to render in this section
component_configobjectConfig passed to the component block

Template fields that a saved layout does not place are appended in an “Other fields” section, so a field added to a template later is not silently hidden.

Component Blocks

Block IDDescriptionModes
entity-assetsAsset browser for the entityedit, view
entity-timelineTimeline of entity eventsedit, view
production-statusProduction pipeline statusedit, view
markdown-contentRenders the entity’s Markdown bodyview
primary-imagePrimary image displayedit, view
entity-chatAI chat scoped to the entityview
entity-relationshipsRelationships to other entitiesview
entity-workflow-triggerWorkflow trigger paneledit
ai-generation-hubAI generation hubedit, view
static-contentStatic content blockedit, view

Plugin blocks use the ID plugin:{pluginId}:{panelId} and are available when the plugin is installed. See Component Blocks for the full reference.

A layout can also set editor_component or viewer_component to a registered block ID to use that block as the entire edit or view page for the type.

Tabs

The edit page tab bar comes from the layout’s tabs array, or from six built-in tabs when none is defined: Visual Editor, YAML Frontmatter, Markdown Content, Preview, Assets, and AI Generation. Plugin panels can add tabs.

FieldDescription
idTab identifier. A built-in id (visual, yaml, markdown, preview, assets, generation) uses the built-in body
labelDisplay label (title is accepted as an alias)
iconOptional icon name
sourcebuiltin, plugin, or template
contentFor custom tabs: { "type": "section_group", "section_ids": [...] }, { "type": "component_block", "block_id": "..." }, or { "type": "plugin_panel", "plugin_panel_id": "plugin:..." }

Sections are not assigned to a tab by a section-level field; a custom tab selects its sections through content.section_ids.

Resolution

The page uses the saved layout for the entity type if one exists (tenant or project scope first, then the shared/global one). If none exists, or the saved one is an auto-generated seed, the layout is auto-generated from the template schema. There is no merging between a saved layout and the auto-generated one, apart from the “Other fields” section described above.

The Layout Designer

The Layout Designer is a drag-and-drop editor for layouts. Open it from Settings > Entity Types, select a type, and choose the Layout tab. It lets you add, remove, and reorder sections, assign fields, insert component blocks, configure tabs, and preview the result.

Layouts can also be edited as JSON. On Core, create _Templates/Layouts/{entity_type}.layout.json and reference field names from the entity’s template.

Layout-Driven View Pages

View (read-only detail) pages follow the layout only when it opts in:

{
  "entity_type": "character",
  "view_config": {
    "layout_driven": true
  },
  "sections": [ ... ]
}

view_config also accepts view_only_sections (extra view-only blocks) and tabs (a tab shell for view mode, using the same tab shape as above).

When layout_driven is not true, the view page uses the type’s bespoke page if one exists; otherwise it renders the template’s auto-generated layout, so custom types always get a browse and detail view.

Next Steps