# Content

<figure><img src="https://3046942752-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHfd391cB6wDC8S3yHcie%2Fuploads%2FG1iDVinD6BGlv0rYDf5x%2Fcore_ui_preview3.jpg?alt=media&#x26;token=70424c8a-2eec-4523-ba12-2f4fb48ab7ce" alt=""><figcaption></figcaption></figure>

The `content` section defines the **main UI area**, supporting **left**, **centre**, and **right** regions. \
Each region can display structured components like input groups or cards, and the layout is fully configurable.

It acts as the core of your UI layout system, with full support for modular pages and responsive content updates.

***

The above image shows the following:&#x20;

🟩 1. Cards in column layout.\
🟥 2. Input Groups\
🟦 3. Cards in Row layout

***

## Configuration

Each content page consists of:

* `index`: (optional) Determines order or default tab position.
* `title`: Displayed in tabs or page headers.
* `layout`: Defines column spans (`left`, `center`, `right`).
* `left`, `center`, `right`: Each region may contain a component block.

```lua
content = {
    pages = {
        my_page = {
            title = "My Page",
            index = 1,
            layout = { left = 2, center = 6, right = 4 },
            left = { type = "cards", title = "Left Section", cards = { ... } },
            center = { type = "input_groups", title = "Center Section", groups = { ... } },
            right = { type = "cards", title = "Right Section", cards = { ... } }
        }
    }
}
```

***

## Content Types

### Cards

Used for displaying visual blocks with optional images, descriptions, hover tooltips, and buttons.

**Example:**

```lua
{
    type = "cards",
    layout = { columns = 1, flex = "row", scroll_x = "scroll", scroll_y = "scroll" },
    title = "Right Section",
    cards = {
        {
            image = "https://placehold.co/64x64",
            title = "Card In Row",
            description = "Card Description.",
            layout = "row",
            on_hover = {
                title = "Card Info",
                description = { "Info descriptions can support arrays", "- like so", "- you get the idea" },
                values = {
                    { key = "Key", value = "Value Pairs" },
                    { key = "Name", value = "Case" }
                },
                actions = {
                    { id = "test_action", key = "E", label = "Action on Keypress", on_keypress = function(data) ... end  }
                },
                rarity = "common"
            },
            buttons = {
                {
                    id = "modal_btn",
                    label = "Modal Button",
                    class = "primary",
                    on_action = function(data) ... end,
                    dataset = {
                        target_id = "example_card",
                        source = "cards_test"
                    },
                    modal = {
                        title = "Modal Title",
                        options = {
                            { id = "name", label = "Name", type = "text" }
                        },
                        buttons = {
                            { id = "modal_button", label = "Modal Button 2", on_action = function(data) ... end }
                        }
                    }
                }
            }
        }
    }
}
```

***

### Input Groups

Used to organize structured form inputs into expandable groupings. \
Can include buttons for submitting or interacting with input data.

**Example:**

```lua
{
  type = "input_groups",
  title = "Input Groups",
  id = "inputs_id",
  layout = { columns = 1 },
  groups = {
    {
      header = "Some Options",
      expandable = false,
      inputs = {
        { id = "opt_1", type = "text", label = "Some Option" },
        { id = "opt_2", type = "number", label = "Another Option" }
      }
    }
  },
  buttons = {
    { id = "input_btn", label = "Input Button", class = "primary", on_action = function(data) ... end }
  }
}
```
