AdminPropsinterface
import { AdminProps } from '@mortar-kit/admin'
interface AdminPropsProperties
bricks: readonly AnyBrick[]The bricks this site defines.
collections: readonly AnyCollection[]The site's collections, in the order the sidebar lists them.
content: ContentReads and writes. Reads should be uncached, so the admin always shows what is saved (the app's server functions, or
createContentin tests).previewUrl: stringURL of the app route that renders
<PreviewPage>from@mortar-kit/admin/preview.location?: AdminLocationWhere the admin is, when the app keeps it (e.g. in the URL). Without it the admin keeps it itself.
onNavigate?: (to: AdminLocation) => voidWith
location: called to go somewhere; the app updateslocation(or doesn't, e.g. when its guard says no).onDirtyChange?: (dirty: boolean) => voidWhether the open document has unsaved changes; see
EditorProps.onDirtyChange.resolveLink?: (url: URL) => { collection: string; slug: string } | undefinedMaps a URL of the site to the document it shows, e.g.
/posts/helloto{ collection: 'posts', slug: 'hello' }. ⌘/Ctrl-clicking a link in the preview opens that document in the admin; a link it doesn't map opens in a new tab. Default: the collections'urlpatterns (resolveUrl).user?: AdminUser | nullThe signed-in user (
auth.user()from@mortar-kit/auth): shown at the foot of the rail, with Sign out.signOutUrl?: stringWhere Sign out posts. Default
/admin/auth/sign-out.