← @mortar-kit/core

PageViewPropsinterface

import { PageViewProps } from '@mortar-kit/core'

interface PageViewProps

Properties

bricks: readonly AnyBrick[]

The bricks this site defines.

entries: readonly PageEntry[]

The entries to render, in order: a page's or a document's body.

doc?: { collection: string; id: string }

The document the entries belong to. Bricks with an action need it: their forms name the entry by collection, document and entry id, so the server can read its stored data. Without it, their forms don't post.

fallback?: (entry: PageEntry) => Element

Rendered in place of an entry whose brick isn't defined (e.g. a brick that was removed from the code). Default: nothing, which suits a public site; the admin preview shows a placeholder.

loadingFallback?: (entry: PageEntry) => Element

Shown while a brick's first load is in flight. Default: nothing.

errorFallback?: (entry: PageEntry, error: unknown) => Element

Shown in place of a brick whose load failed. Without it, the error reaches the app's own error boundary (a server render fails with it); the admin preview passes one. It clears when the brick loads again: when data its loader read before its first await changes, or the source's track signal does.

wrap?: (id: string, view: Element) => Element

Renders around each entry, given its id (stable for the entry's life). Default: nothing around it. The admin preview marks entries with it, so a click can find the entry it landed in.