# UI Schemas

UI Schemas customize how Contextual renders Object Type records in the admin experience.

At a high level, Contextual uses JSON Forms-style UI schemas for form layouts, but it also supports additional styles and options that go beyond vanilla JSON Forms.

## Supported styles

Contextual UI Schemas can define different layouts for different experiences:

* `createStyle` - layout for creating a new record
* `updateStyle` - layout for editing an existing record
* `readStyle` - layout for read-only record views
* `duplicateStyle` - layout used when duplicating an existing record
* `listStyle` - table/list configuration for collections of records
* `relatedStyle` - related-record presentation used by relation-aware views

## How this differs from vanilla JSON Forms

The form-oriented styles (`createStyle`, `updateStyle`, `readStyle`) follow the usual JSON Forms idea of composing controls and layouts.

Contextual also adds platform-specific styles and behavior, especially for:

* list/table configuration
* duplicate views
* related-record views
* specialized renderers selected by schema `renderer` values or UI schema `options.renderer`

## List-style configuration

`listStyle` controls how records appear in grids and list views. In the current product, it supports concepts such as:

* `columns`
* default `order`
* pagination options such as including or excluding the total-count request
* column sizing such as `width`, `minWidth`, `maxWidth`, and `flex`

When you do not define a custom list schema, Contextual generates a default one from the scalar properties in your Object Type and uses the `primaryKey` as the default sort.

## Custom renderers

Contextual supports custom renderers that are not part of standard JSON Forms. Examples visible in the current admin console include `code-editor`, `relation`, and `flow-relation`.

These renderers can be selected either:

* directly on a schema property via `renderer`
* through UI schema options such as `options.renderer`

For schema-level extensions that drive these behaviors, see [Contextual Schema Extensions](/documentation-and-resources/components-and-data/object-types/object-type-details/data-schema/contextual-schema-extensions.md).

## Practical guidance

* start with the generated defaults and customize only where the default UX is not sufficient
* use form styles for layout and grouping
* use `listStyle` when the record grid needs custom columns, order, or pagination behavior
* use renderer-driven customization sparingly and intentionally, since it couples the schema to Contextual-specific UI behavior

<figure><img src="/files/gqzRcRoKCnOo0bCrSuNA" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.contextual.io/documentation-and-resources/components-and-data/object-types/object-type-details/ui-schemas.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
