> ## Documentation Index
> Fetch the complete documentation index at: https://docs.borntocraftstudio.net/llms.txt
> Use this file to discover all available pages before exploring further.

# Introduction to OmniGui

> The modular layout system for inventory menus

# Overview

The GUI extension provides a **modular layout system** for creating inventory menus. Instead of manually placing items at fixed slots, you define a tree of layouts that the engine assembles at runtime. Layouts nest like Russian dolls — a `ScrollableLayout` wraps a `SimpleLayout`, a `CompositeLayout` combines multiple children, etc.

## Core Concepts

| Concept            | Description                                                                                 |
| ------------------ | ------------------------------------------------------------------------------------------- |
| **MenuDefinition** | The complete GUI definition: type (CHEST, ANVIL...), title, size, root layout, audio        |
| **MenuLayout**     | Abstract node in the layout tree — produces `GuiSlot` items for a viewport                  |
| **layoutPool**     | JSON array of named layouts, referenced by `mainLayoutId`                                   |
| **mainLayoutId**   | ID of the root layout to display                                                            |
| **Viewport**       | Visible area (default 9×6 for a double chest). Scrollable layouts have larger virtual sizes |

## Architecture

```mermaid theme={null}
graph TD
    MD[MenuDefinition] --> L[Layout Pool]
    MD --> ML[mainLayoutId: 'main']
    ML --> CL[CompositeLayout 'main']
    CL --> SL1[SimpleLayout 'borders']
    CL --> SC[ScrollableLayout 'my_scroll']
    SC --> SL2[SimpleLayout 'my_content']
```
