Skip to content

NextAdminPage

NextAdminPage(props): Promise<Element>

Defined in: packages/next/src/NextAdminPage.tsx:51

VexCMS admin page server component for Next.js.

An async server component that routes by the [[...slug]] catch-all params, prefetches Convex data via fetchQuery, and renders the correct view component. Does not include a layout wrapper — VexAdminLayout in app/admin/layout.tsx owns the persistent shell.

Route mapping:

path arrayView
[] or undefinedDashboardView
[collectionSlug]CollectionListView with preloaded docs
[collectionSlug, "new"]CollectionEditView (empty form)
[collectionSlug, documentId]CollectionEditView with preloaded doc

Component props

VexConfig

The resolved VexCMS configuration from vex.config.ts

Promise<{ path?: string[]; }>

Next.js 15 async params { path?: string[] }

string

Promise<Element>

The appropriate admin view for the current URL path.

app/admin/[[...slug]]/page.tsx
import { VexAdminPage } from "@vexcms/next";
import config from "../../../../vex.config";
export default function AdminPage({
params,
}: {
params: Promise<{ path?: string[] }>;
}) {
return <VexAdminPage config={config} params={params} />;
}