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

# Layout Builder

> Full-screen drag-and-drop interface for arranging field display order and layout for a specific entity type and view context, with version history and rollback.

Layout Builder is the full-screen editor at `/settings/field-config/:entityType/layout` that provides a drag-and-drop canvas for arranging field positions and layout for a specific entity type and view context. It includes a live preview and a version history panel with rollback capability.

## Overview

The page reads the `:entityType` URL parameter and a `viewContext` selector (default `edit_form`). It loads existing field configurations via `useEntityFieldConfigs` and renders `FieldConfigLayoutEditor` for drag-and-drop layout editing. A `FieldConfigPreview` panel shows the layout as it will appear to end users. A version history sheet (`FieldConfigVersionHistory`) lists saved versions and allows rolling back to a prior state via `rollbackToVersion`.

Navigate to this page from [Field Configuration](/pf/field-configuration) by clicking the layout action for an entity.

## Who it's for

Access follows your organization's role and module configuration. SME should confirm intended access.

## Before you start

* Identify the entity type you want to lay out. The entity must already have field configurations (see [Field Configuration](/pf/field-configuration)).
* Saving a new layout creates a new version; prior layouts can be restored via version history.

## Steps

1. Navigate to **Settings → Field Config** (`/settings/field-config`).
2. Select an entity type and click the layout icon to open `/settings/field-config/:entityType/layout`.
3. Use the **View Context** selector to switch between layout contexts (Create Form, Edit Form, etc.).
4. Drag and drop fields in `FieldConfigLayoutEditor` to rearrange the layout.
5. Click **Preview** to see the rendered layout in `FieldConfigPreview`.
6. Click **Save** to save the current layout as a new version.
7. To restore a prior layout, open **Version History**, select a version, and click **Rollback**.

## Key concepts

**View context** — the rendering context (`create_form`, `edit_form`, `detail_view`, `list_view`, `wizard`) that determines which layout is edited.

**Version history** — each saved layout is stored as a `FieldConfigVersion`. Rollback restores the selected version as the active layout.

## Related

<Columns cols={2}>
  <Card title="Platform Foundation" icon="layer-group" href="/pf/overview">
    Platform Foundation overview.
  </Card>

  <Card title="Governance & parity" icon="scale-balanced" href="/governance/index" />
</Columns>

<Note>
  This page documents shipped product behavior. It is not medical, legal, or
  billing advice. Verify against your organization's policies and applicable
  regulations before using it for clinical, compliance, or billing decisions.
  Protected health information (PHI) shown in the product is governed by your
  tenant's access controls and is never exposed in this documentation.
</Note>

<Accordion title="Documentation sources">
  * src/routes/platform.tsx
  * src/platform/field-config/pages/LayoutBuilderPage.tsx
  * src/platform/field-config/hooks/useEntityFieldConfigs.ts
</Accordion>
