AdminTopNav
AdminTopNav(
props):Element
Defined in: packages/react/src/admin/AdminTopNav.tsx:334
Admin top bar: breadcrumb trail, sidebar trigger, and “View site” link.
Rendered by NextAdminPage itself (top-bar move, shell-streaming follow-up, developer-
approved) — NOT by AdminLayout (which keeps only the sidebar and the main column frame) —
specifically so the document-title crumb lives inside the SAME HydrationBoundary
NextAdminPage wraps its own view content in, as a true descendant, not a layout-level
sibling. NextAdminPage renders this on EVERY branch (dashboard, list, edit, globals,
media, not-found), passing the SAME activeSlug/activeDocID it already derives from the
route params server-side — no more usePathname() parsing, no more mounted gate (the
cause of the pre-existing “document crumb never shows” bug this move also fixes, alongside a
genuine drafts-key mismatch bug found and fixed in the same investigation).
Horizontal padding is px-6 (NOT px-4), matching NextAdminPage’s own content wrapper
(className="min-h-0 flex-1 p-6 pt-0") exactly — developer-reported: the bar’s edges
must line up with the page content column’s edges (e.g. a list/dashboard page’s own
title) on BOTH sides, not just visually approximate it. A mismatched padding here is a
recurring trap: px-4 (16px) looked “close enough” at a glance but was a real,
measurable 8px off from the content’s own 24px — verify any future bar-padding change
against getBoundingClientRect(), not eyeballing.
Parameters
Section titled “Parameters”activeDocID?
Section titled “activeDocID?”string
The active document id (edit routes) or global slug (global edit,
same convention adminHref/AppSidebar already use), or undefined otherwise.
activeSlug?
Section titled “activeSlug?”string
The active collection/media-collection slug, "collections" for
the collections-only index route, "globals" for any globals route, or undefined on
the dashboard.
Returns
Section titled “Returns”Element
The sticky top bar.