# View components

AI agent getting started? Read [Agents: start here](https://docs.openeng.io/agents/start-here.md) first.

Components, supported views, props and limits.

Source: https://docs.openeng.io/reference/view-components/

Views decide how objects look. A type declares up to three:

Use `presentationBindings.multiline: ["sourceText"]` for string properties that need text areas.
Creation and property drafts preserve newlines; read mode wraps plain text with its line breaks.
Enter inserts a newline and Command+Enter uses the form's normal submit action.
Names must be distinct string properties of the type; this changes no property schema or type hash.
Unknown names are refused as `unknown-multiline-property`;
non-string properties as `multiline-property-must-be-string`.

- The **object view**, in `presentationBindings.views.object`, lays out one object's detail panel.
- The **app view**, in `presentationBindings.views.app`, lays out the type's collection, such as a table.
- The **card**, in `presentationBindings.views.card`, is the small summary a type draws for an object, for example on a graph node.

A view is a tree of the components below. This small object view shows an object's `identifier` and `statement` properties:

```json
{
  "root": "body",
  "elements": {
    "body": {
      "type": "ObjectBody",
      "props": {},
      "children": [
        "properties"
      ]
    },
    "properties": {
      "type": "PropertyList",
      "props": {
        "fields": [
          "identifier",
          "statement"
        ]
      },
      "children": []
    }
  }
}
```

Each entry below lists the views the component works in, its role, the rules for its children and its props.

To change a view, edit the type in a change set, by hand or with the ontology agent, then accept the change set to publish it. [Views and configuration](https://docs.openeng.io/concepts/views.md) explains each step.

Limits:

- 100 view elements
- 100 children per element
- 12 card elements

## How to read this page

Choose a component supported in your view kind. Its entry lists props and structural rules; validation checks both. The role describes how the component participates in the layout.

| Component | Views | Role |
| --- | --- | --- |
| [Stack](#stack) | object, app, page, card | container |
| [Grid](#grid) | object, app, page | container |
| [Section](#section) | object, app, page | container |
| [Heading](#heading) | object, app, page | leaf |
| [Text](#text) | object, app, page, card | leaf |
| [Separator](#separator) | object, app, page, card | leaf |
| [ObjectBody](#objectbody) | object | container |
| [CardBody](#cardbody) | card | container |
| [PropertyList](#propertylist) | object, card | leaf |
| [PropertyField](#propertyfield) | object, card | leaf |
| [ConnectionList](#connectionlist) | object | leaf |
| [ObjectCard](#objectcard) | object | leaf |
| [STLViewer](#stlviewer) | object | leaf |
| [ImageViewer](#imageviewer) | object | leaf |
| [PdfViewer](#pdfviewer) | object | leaf |
| [AppBody](#appbody) | app, page | container |
| [ObjectTable](#objecttable) | app | leaf |
| [ObjectList](#objectlist) | app | leaf |
| [MetricCard](#metriccard) | object, app | leaf |
| [ObjectCount](#objectcount) | app | leaf |
| [Value](#value) | object, app, page, card | leaf |
| [Badge](#badge) | object, app, page, card | leaf |
| [Stat](#stat) | object, app, page | leaf |
| [Aggregate](#aggregate) | object, app | leaf |
| [Link](#link) | object, app, page | leaf |
| [Button](#button) | object, app, page | leaf |
| [List](#list) | object, app, page | container |
| [Table](#table) | object, app, page | container |
| [Column](#column) | object, app, page | container |
| [Tabs](#tabs) | object, app, page | container |
| [TabPanel](#tabpanel) | object, app, page | container |
| [Disclosure](#disclosure) | object, app, page | container |
| [Card](#card) | object, app, page | container |
| [Search](#search) | object, app, page | leaf |
| [Select](#select) | object, app, page | leaf |
| [Toggle](#toggle) | object, app, page | leaf |
| [Query](#query) | object, app, page | leaf |

## Stack

Views: object, app, page, card

Role: container

- `direction`: {"kind":"choice","required":true,"values":["row","column"],"error":"Invalid stack direction"}
- `gap`: {"kind":"choice","required":true,"values":["small","medium","large"],"error":"Invalid stack gap"}

## Grid

Views: object, app, page

Role: container

- `columns`: {"kind":"number","required":true,"integer":true,"min":1,"max":4,"error":"Invalid grid columns"}

## Section

Views: object, app, page

Role: container

- `heading`: {"kind":"string","required":true,"minLength":1,"maxLength":160,"error":"Invalid section heading"}
- `description`: {"kind":"string","minLength":1,"maxLength":400,"error":"Invalid section description"}

## Heading

Views: object, app, page

Role: leaf

- `text`: {"kind":"string","required":true,"minLength":1,"maxLength":160,"error":"Invalid heading text"}
- `level`: {"kind":"number","required":true,"integer":true,"min":2,"max":4,"error":"Invalid heading level"}

## Text

Views: object, app, page, card

Role: leaf

- `text`: {"kind":"string","required":true,"minLength":1,"maxLength":2000,"error":"Invalid text"}

## Separator

Views: object, app, page, card

Role: leaf



## ObjectBody

Views: object

Role: container

Structure:
- Required root of object views.

- `derived`: {"kind":"derivedDefinitions","error":"Invalid derived values"}

## CardBody

Views: card

Role: container

Structure:
- Required root of card views.

- `fields`: {"kind":"stringList","required":true,"minItems":1,"maxItems":12,"unique":true,"propertyKeys":true,"error":"Invalid card fields"}

## PropertyList

Views: object, card

Role: leaf

Structure:
- Must appear exactly 1 time in card views.

- `fields`: {"kind":"stringList","views":["object"],"maxItems":100,"unique":true,"propertyKeys":true,"error":"Unknown or duplicate property key"}
- `readOnly`: {"kind":"boolean","views":["object"],"error":"Invalid read-only flag"}
- `units`: {"kind":"stringMap","maxEntries":100,"minLength":1,"maxLength":32,"keysWithin":"fields","error":"Invalid unit"}
- `precision`: {"kind":"integerMap","maxEntries":100,"min":0,"max":10,"keysWithin":"fields","error":"Invalid precision"}

## PropertyField

Views: object, card

Role: leaf

- `field`: {"kind":"string","required":true,"minLength":1,"maxLength":64,"propertyKey":true,"error":"Unknown property key"}
- `readOnly`: {"kind":"boolean","views":["object"],"error":"Invalid read-only flag"}
- `unit`: {"kind":"string","minLength":1,"maxLength":32,"error":"Invalid unit"}
- `precision`: {"kind":"number","integer":true,"min":0,"max":10,"error":"Invalid precision"}

## ConnectionList

Views: object

Role: leaf



## ObjectCard

Views: object

Role: leaf



## STLViewer

Views: object

Role: leaf

- `property`: {"kind":"string","required":true,"minLength":1,"maxLength":64,"propertyKey":true,"attachmentClass":"mesh","error":"Unknown geometry property"}
- `label`: {"kind":"string","minLength":1,"maxLength":160,"error":"Invalid geometry label"}

## ImageViewer

Views: object

Role: leaf

- `property`: {"kind":"string","required":true,"minLength":1,"maxLength":64,"propertyKey":true,"attachmentClass":"image","error":"Unknown image property"}
- `alt`: {"kind":"string","required":true,"minLength":1,"maxLength":500,"error":"Invalid alternative text"}

## PdfViewer

Views: object

Role: leaf

- `property`: {"kind":"string","required":true,"minLength":1,"maxLength":64,"propertyKey":true,"attachmentClass":"pdf","error":"Unknown PDF property"}
- `label`: {"kind":"string","minLength":1,"maxLength":160,"error":"Invalid PDF label"}

## AppBody

Views: app, page

Role: container

Structure:
- Required root of app and page views.

- `derived`: {"kind":"derivedDefinitions","views":["app"],"error":"Invalid derived values"}

## ObjectTable

Views: app

Role: leaf

- `fields`: {"kind":"stringList","minItems":1,"maxItems":100,"unique":true,"propertyKeys":true,"error":"Unknown or duplicate property key"}
- `derived`: {"kind":"list","item":{"kind":"derivedId","error":"Unknown derived value"},"minItems":1,"maxItems":16,"unique":true,"error":"Unknown or duplicate derived value"}
- `readOnly`: {"kind":"boolean","error":"Invalid read-only flag"}

## ObjectList

Views: app

Role: leaf

- `card`: {"kind":"shape","error":"Invalid card","props":{"fields":{"kind":"stringList","required":true,"minItems":1,"maxItems":12,"unique":true,"propertyKeys":true,"error":"Unknown or duplicate property key"},"readOnly":{"kind":"boolean","error":"Invalid read-only flag"}}}

## MetricCard

Views: object, app

Role: leaf

- `label`: {"kind":"string","required":true,"minLength":1,"maxLength":160,"error":"Invalid metric label"}
- `values`: {"kind":"list","required":true,"minItems":1,"maxItems":2,"error":"Invalid metric values","item":{"kind":"union","discriminator":"source","error":"Invalid metric value","members":{"property":{"views":["object"],"props":{"field":{"kind":"string","required":true,"minLength":1,"maxLength":64,"propertyKey":true,"error":"Unknown property key"},"label":{"kind":"string","minLength":1,"maxLength":160,"error":"Invalid metric label"},"unit":{"kind":"string","minLength":1,"maxLength":32,"error":"Invalid unit"},"precision":{"kind":"number","integer":true,"min":0,"max":10,"error":"Invalid precision"}}},"derived":{"views":["object"],"props":{"id":{"kind":"derivedId","required":true,"error":"Unknown derived value"},"label":{"kind":"string","minLength":1,"maxLength":160,"error":"Invalid metric label"}}},"count":{"views":["app"],"props":{"label":{"kind":"string","minLength":1,"maxLength":160,"error":"Invalid metric label"}}}}}}

## ObjectCount

Views: app

Role: leaf

- `label`: {"kind":"string","maxLength":160,"error":"Invalid count label"}

## Value

Views: object, app, page, card

Role: leaf

- `value`: {"kind":"scalar","required":true,"maxLength":2000,"bindable":"read","error":"Invalid value"}
- `label`: {"kind":"string","minLength":1,"maxLength":160,"error":"Invalid value label"}

## Badge

Views: object, app, page, card

Role: leaf

- `label`: {"kind":"scalar","required":true,"maxLength":160,"bindable":"read","error":"Invalid badge label"}
- `tone`: {"kind":"choice","values":["neutral","info","success","warning","danger"],"error":"Invalid badge tone"}
- `tones`: {"kind":"choiceMap","maxEntries":32,"values":["neutral","info","success","warning","danger"],"error":"Invalid badge tones"}

## Stat

Views: object, app, page

Role: leaf

Structure:
- Must have exactly one of these props: `value`, `aggregate`.

- `label`: {"kind":"string","required":true,"minLength":1,"maxLength":160,"error":"Invalid stat label"}
- `value`: {"kind":"scalar","maxLength":160,"bindable":"read","error":"Invalid stat value"}
- `unit`: {"kind":"string","minLength":1,"maxLength":32,"error":"Invalid unit"}
- `query`: {"kind":"string","minLength":1,"maxLength":64,"part":true,"error":"Unknown query part"}
- `aggregate`: {"kind":"string","views":["object","app"],"minLength":1,"maxLength":64,"aggregatePart":true,"error":"Unknown aggregate part"}

## Aggregate

Views: object, app

Role: leaf

- `reach`: {"kind":"json","required":true,"error":"Invalid aggregate reach"}
- `measure`: {"kind":"json","required":true,"error":"Invalid aggregate measure"}
- `ends`: {"kind":"choice","required":true,"values":["visible","all"],"error":"Invalid aggregate ends"}

## Link

Views: object, app, page

Role: leaf

Structure:
- Must have exactly one of these props: `object`, `page`.

- `object`: {"kind":"objectRef","error":"Invalid link object"}
- `page`: {"kind":"string","views":["page"],"minLength":1,"maxLength":64,"pageKey":true,"error":"Invalid link page"}
- `label`: {"kind":"scalar","required":true,"maxLength":160,"bindable":"read","error":"Invalid link label"}

## Button

Views: object, app, page

Role: leaf

Structure:
- Carries a press action.
- Acts on its own subject in object views.

- `label`: {"kind":"string","required":true,"minLength":1,"maxLength":160,"error":"Invalid button label"}
- `variant`: {"kind":"choice","required":true,"values":["primary","secondary","danger"],"error":"Invalid button variant"}

## List

Views: object, app, page

Role: container

Structure:
- Must have exactly 1 child.
- Children use the item and index from the query named by `query`.
- Repeats its children for each query result.

- `query`: {"kind":"string","required":true,"minLength":1,"maxLength":64,"part":true,"error":"Unknown query part"}
- `selection`: {"kind":"string","views":["page"],"bindable":"write","bindOnly":true,"error":"Invalid selection"}

## Table

Views: object, app, page

Role: container

Structure:
- Must have between 1 and 12 children.
- May contain only Column children.
- Children use the item and index from the query named by `query`.

- `query`: {"kind":"string","required":true,"minLength":1,"maxLength":64,"part":true,"error":"Unknown query part"}
- `selection`: {"kind":"string","views":["page"],"bindable":"write","bindOnly":true,"error":"Invalid selection"}

## Column

Views: object, app, page

Role: container

Structure:
- May only appear inside Table.
- Must have exactly 1 child.

- `header`: {"kind":"string","required":true,"minLength":1,"maxLength":160,"error":"Invalid column header"}

## Tabs

Views: object, app, page

Role: container

Structure:
- Must have between 1 and 12 children.
- May contain only TabPanel children.

- `label`: {"kind":"string","minLength":1,"maxLength":160,"error":"Invalid tabs label"}

## TabPanel

Views: object, app, page

Role: container

Structure:
- May only appear inside Tabs.

- `label`: {"kind":"string","required":true,"minLength":1,"maxLength":160,"error":"Invalid tab label"}

## Disclosure

Views: object, app, page

Role: container

- `title`: {"kind":"string","required":true,"minLength":1,"maxLength":160,"error":"Invalid disclosure title"}
- `open`: {"kind":"boolean","error":"Invalid disclosure state"}

## Card

Views: object, app, page

Role: container

- `title`: {"kind":"string","minLength":1,"maxLength":160,"error":"Invalid card title"}

## Search

Views: object, app, page

Role: leaf

- `label`: {"kind":"string","required":true,"minLength":1,"maxLength":160,"error":"Invalid search label"}
- `value`: {"kind":"string","required":true,"maxLength":200,"bindable":"write","error":"Invalid search value"}

## Select

Views: object, app, page

Role: leaf

- `label`: {"kind":"string","required":true,"minLength":1,"maxLength":160,"error":"Invalid select label"}
- `value`: {"kind":"string","required":true,"maxLength":200,"bindable":"write","error":"Invalid select value"}
- `property`: {"kind":"string","views":["object","app"],"minLength":1,"maxLength":64,"propertyKey":true,"error":"Unknown property key"}
- `options`: {"kind":"stringList","minItems":1,"maxItems":50,"unique":true,"error":"Invalid select options"}

## Toggle

Views: object, app, page

Role: leaf

- `label`: {"kind":"string","required":true,"minLength":1,"maxLength":160,"error":"Invalid toggle label"}
- `value`: {"kind":"boolean","required":true,"bindable":"write","error":"Invalid toggle value"}

## Query

Views: object, app, page

Role: leaf

- `start`: {"kind":"shape","views":["page"],"required":true,"exactlyOne":true,"error":"Invalid query start","props":{"type":{"kind":"string","minLength":1,"maxLength":64,"error":"Invalid query start"},"part":{"kind":"string","minLength":1,"maxLength":64,"part":true,"error":"Invalid query start"},"selection":{"kind":"string","minLength":1,"maxLength":64,"selecting":true,"error":"Invalid query start"}}}
- `hops`: {"kind":"list","views":["page"],"maxItems":100,"error":"Invalid query hops","item":{"kind":"shape","error":"Invalid query hop","props":{"edgeTypeKey":{"kind":"string","required":true,"minLength":1,"maxLength":64,"error":"Invalid query hop"},"direction":{"kind":"choice","required":true,"values":["outgoing","incoming","to-children","to-parent"],"error":"Invalid query hop"},"targetTypeKey":{"kind":"string","required":true,"minLength":1,"maxLength":64,"error":"Invalid query hop"},"filters":{"kind":"queryFilters","maxItems":16,"error":"Invalid query filters"}}}}
- `typeKey`: {"kind":"string","required":true,"minLength":1,"maxLength":64,"ownerTypeKey":true,"error":"Invalid query type"}
- `filters`: {"kind":"queryFilters","maxItems":16,"error":"Invalid query filters"}
- `sort`: {"kind":"querySort","error":"Invalid query sort"}
- `limit`: {"kind":"number","required":true,"integer":true,"min":1,"max":100,"error":"Invalid query limit"}
- `fields`: {"kind":"stringList","required":true,"minItems":1,"maxItems":50,"unique":true,"propertyKeys":true,"error":"Unknown or duplicate property key"}
