# Containers

<PageBadges />

import { Callout } from "zudoku/ui/Callout"

## Section

```json
{
  "type": "Section",
  "key": "details",
  "data_name": "details",
  "label": "Details",
  "display": "inline",
  "description": null,
  "description_mode": null,
  "visible": true,
  "visible_conditions": null,
  "elements": []
}
```

Additional attributes:

- `display`: `inline` or `drilldown`.
- `elements`: Nested fields.

## RepeatableSection

```json
{
  "type": "RepeatableSection",
  "key": "items",
  "data_name": "items",
  "label": "Items",
  "display": "drilldown",
  "description": null,
  "description_mode": null,
  "visible": true,
  "visible_conditions": null,
  "location_enabled": false,
  "location_required": false,
  "title_field": {
    "type": "TitleField",
    "key": "@title",
    "data_name": "title",
    "label": "Title",
    "display": "default",
    "enabled": true,
    "visible": true,
    "visible_conditions": null,
    "read_only": true,
    "read_only_conditions": null,
    "elements": ["item_name", "item_date"]
  },
  "elements": [
    {
      "type": "TextField",
      "key": "item_name",
      "data_name": "item_name",
      "label": "Item name"
    },
    {
      "type": "DateField",
      "key": "item_date",
      "data_name": "item_date",
      "label": "Item date"
    }
  ]
}
```

Additional attributes:

- `location_enabled`: Enables location data for items.
- `location_required`: Requires location data for items.
- `title_field`: Optional `TitleField` used to derive each child record's title. Use `null` when no
  entry title is configured.

Repeatable sections create an array of child records in the output. A configured entry title is
stored as `@title` on each child record. If all title parts are blank, `@title` is `null`; renderers
may show a positional label such as `Items 1`, but that fallback is not persisted.

Title references are scoped to the repeatable's own child-record dataset. They may point to fields
inside ordinary nested `Section` containers, but not to fields outside the repeatable or inside a
nested `RepeatableSection`. Eligible types are `TextField`, `NumericField`, `DateField`, `TimeField`,
`SingleChoiceField`, `MultiChoiceField`, `BooleanField`, and `CalculatedField`. Ordered field keys are
preferred, while `data_name` references are accepted for authored schemas.

## BuildingPlanSection

```json
{
  "type": "BuildingPlanSection",
  "key": "building_plan",
  "data_name": "building_plan",
  "label": "Building plan",
  "description": null,
  "description_mode": null,
  "visible": true,
  "visible_conditions": null,
  "read_only": false,
  "read_only_conditions": null,
  "building_plan": { "nodes": [], "edges": [] },
  "node_overrides": null,
  "elements": []
}
```

Additional attributes:

- `building_plan`: Structure describing the plan topology.
- `node_overrides`: Overrides for generated nodes.

<Callout type="info" title="Building plan expansion">
  BuildingPlanSection expands into nested RepeatableSections at runtime. We will expand this
  documentation with full examples soon.
</Callout>
