Adds a front-end browser for large nested document trees such as taxonomies. It reads a collection that stores each document's path directly from MongoDB, picks a layout per level based on child count, and offers a Show all view on every shortened list. It needs the MongoDB adapter, Payload 3.80 or later, React 19 and Node 22. Because it bypasses Payload access rules, a filter option must exclude private content.
Nested Docs Browser for Payload: browse large hierarchies in pages that adapt to how much is inside, with Show all on every shortened view, an A-Z index and saved groups over the tree.
Installation
npm i @extantape/payload-plugin-nested-docs-browser0
Stars
0
Forks
0
Open Issues
1 weeks ago
Last Updated
137
Weekly Downloads
v0.3.0
npm Version
99.0 KB
Unpacked Size
0
Dependencies
00 since Nov 8
| Date | Stars |
|---|---|
| Dec 6, 2026 | 0 |
| Dec 5, 2026 | 0 |
| Dec 4, 2026 | 0 |
| Dec 3, 2026 | 0 |
| Dec 2, 2026 | 0 |
| Dec 1, 2026 | 0 |
| Nov 30, 2026 | 0 |
| Nov 29, 2026 | 0 |
| Nov 28, 2026 | 0 |
| Nov 27, 2026 | 0 |
| Nov 26, 2026 | 0 |
| Nov 25, 2026 | 0 |
| Nov 24, 2026 | 0 |
| Nov 23, 2026 | 0 |
| Nov 22, 2026 | 0 |
| Nov 21, 2026 | 0 |
| Nov 20, 2026 | 0 |
| Nov 19, 2026 | 0 |
| Nov 18, 2026 | 0 |
| Nov 17, 2026 | 0 |
| Nov 16, 2026 | 0 |
| Nov 15, 2026 | 0 |
| Nov 14, 2026 | 0 |
| Nov 13, 2026 | 0 |
| Nov 12, 2026 | 0 |
| Nov 11, 2026 | 0 |
| Nov 10, 2026 | 0 |
| Nov 9, 2026 | 0 |
| Nov 8, 2026 | 0 |
146+146 since Nov 11
| Date | Weekly downloads |
|---|---|
| Dec 6, 2026 | 146 |
| Dec 5, 2026 | 185 |
| Dec 4, 2026 | 355 |
| Dec 3, 2026 | 387 |
| Dec 2, 2026 | 416 |
| Dec 1, 2026 | 438 |
| Nov 30, 2026 | 475 |
| Nov 29, 2026 | 557 |
| Nov 28, 2026 | 539 |
| Nov 27, 2026 | 377 |
| Nov 26, 2026 | 347 |
| Nov 25, 2026 | 333 |
| Nov 24, 2026 | 521 |
| Nov 23, 2026 | 490 |
| Nov 22, 2026 | 578 |
| Nov 21, 2026 | 548 |
| Nov 20, 2026 | 533 |
| Nov 19, 2026 | 502 |
| Nov 18, 2026 | 469 |
| Nov 17, 2026 | 222 |
| Nov 16, 2026 | 202 |
| Nov 15, 2026 | 0 |
| Nov 14, 2026 | 719 |
| Nov 13, 2026 | 649 |
| Nov 12, 2026 | 0 |
| Nov 11, 2026 | 0 |
Each point is npm's rolling 7-day download count.
Health Score
Composite score based on GitHub activity, stars, npm downloads, publish recency, dependency count, and package size.
Badge for your README
[](https://payloaddirectory.dev/plugins/1452073493-root)<a href="https://payloaddirectory.dev/plugins/1452073493-root"><img src="https://payloaddirectory.dev/badge/1452073493-root.svg" alt="Payload Directory"></a>README
Nested Docs Browser for Payload: browse large hierarchies in pages that adapt to how much is inside, with Show all on every shortened view, an A–Z index and saved groups over the tree.
Status: early, 0.x.
equals: 'extinct'), or everything not confirmed (notEquals: 'living'). The switch says how many are hidden.nested-groups collection saves groups people know, each "these branches minus those". For example, "lizards" is Squamata minus snakes minus geckos. Groups are views: they never change the tree, and their counts are live. A curator check lists leaves that fall in no group, or in two.ndb-card__name, ndb-compact__row, …), and state is in data attributes (data-layout, data-leaf, data-hidden, data-empty, data-share).--ndb-* variables. Each falls back to a generic theme token (--palette-primary, --palette-surface-raised, …), then to a default, so a site-wide theme restyles the browser with nothing else to do.classNames adds your classes to any element, and unstyled leaves everything to you.It needs the MongoDB adapter, and a collection that stores each document's path, like animalia/chordata/reptilia or a Nested Docs breadcrumb URL.
On its own. Nested Docs Browser needs the MongoDB adapter and a collection that stores each document's path. Its default look works with no theme at all. It doesn't use any other plugin.
Needs. Payload ^3.80.0 and React ^19.0.0 as peer dependencies. No other EXTANT APE plugin is required.
Works with:
@extantape/payload-plugin-color-theory): each --ndb-* variable falls back to a --palette-* token, and Color Theory writes those, so the browser follows the site's theme in light and dark. Neither imports the other, and any theme that sets the same token names works too.@payloadcms/plugin-nested-docs): its breadcrumb URL can serve as the path field.Color Theory. Yes, through the --palette-* fallbacks in the Color Theory entry above.
Family. Nested Docs Browser is in the Navigation family, with Menu. They're meant to sit side by side in a site's navigation, but nothing in either plugin's code connects them yet. The families are a working draft that may change.
npm install @extantape/payload-plugin-nested-docs-browser
Needs Payload 3.80 or later, React 19 and Node 22 or later.
import { nestedDocsBrowser } from '@extantape/payload-plugin-nested-docs-browser'
nestedDocsBrowser({
collection: 'taxa',
pathField: 'path',
leaf: { field: 'rank', equals: 'species' },
hideByDefault: { field: 'extant', equals: 'extinct', label: 'fossil' },
describe: (doc) => ({ name: doc.name, everyday: doc.everydayName ?? null }),
href: (path) => `/taxa/${path}`,
groups: { imageCollection: 'media', access: { create: isCurator, update: isCurator, delete: isCurator } },
})
On a page (a server component):
import { browse } from '@extantape/payload-plugin-nested-docs-browser'
import { NestedDocsBrowser } from '@extantape/payload-plugin-nested-docs-browser/client'
const data = await browse(payload, options, 'animalia/chordata/reptilia/squamata')
return <NestedDocsBrowser data={data} noun="families" Link={Link} />
Or over HTTP: GET /api/nested-docs-browser/<collection>?path=…, …/groups, …/groups/<id>, and …/groups-check?scope=…. The check is only for people allowed to change groups: the groups' update rule must answer exactly true, or a query. A query limits the check to the groups it matches (the answer's groups says how many), so none means "in none of those". An empty or malformed query, one on a field the groups don't have, any other truthy answer, and an error are all refused with 403.
What it shows, and to whom. For speed, the browser reads the collection straight from MongoDB, so Payload's access rules, drafts and hidden fields don't apply to it. Only two options decide what it shows:
filter (a MongoDB filter) must leave out anything visitors mustn't see: drafts (_status: 'published' if the collection has drafts), private or archived records, another site's records on a multi-site install.access decides who may call the endpoints. Without it they're public. Only an answer of exactly true lets a request through: 1, 'yes', an object or a thrown error gets 403, never a 500.Names, everyday names and images come from describe, so return only what's fine to show. It suits public reference data, such as a taxonomy. The cache holds at most 500 entries and never keeps a miss.
A deep tree makes a long trail. You can fold the levels people don't need into one … button, or leave them out. Nothing leaves the data: the button lists every hidden level as a link, and the structured data keeps the whole path.
Set levelField so each ancestor carries its kind of level (for a taxonomy, its rank):
nestedDocsBrowser({ collection: 'taxa', levelField: 'rank', /* … */ })
Then say which levels show:
<NestedDocsBrowser
data={data}
noun="species"
crumbs={{
leading: [{ name: 'Taxonomy', href: '/taxonomy' }],
keep: { levels: ['class', 'order', 'family', 'genus'] },
narrow: { levels: ['family', 'genus'] },
structuredData: { origin: 'https://example.org' },
}}
/>
A red-footed tortoise's page then reads Taxonomy / Eukaryota / … / Reptilia / Testudines / … / Testudinidae / Chelonoidis, and on a phone Taxonomy / Eukaryota / … / Testudinidae / Chelonoidis.
keep takes any of levels (by the level's value, case ignored), first and last (by position), and test (your own function). A level shows when any of them matches. Without keep, every level shows, as before.leading index pages, the first real level of the tree and the current page.mode: 'hide' leaves hidden levels out with no marker.open: 'popover' (default) opens a list of links on click or tap. 'expand' puts the levels back in place and moves focus to the first one. 'hover' opens on mouse hover, with tap and keyboard as the fallback.aria-expanded. Escape or a click outside closes the list and puts focus back on the button.narrow is a second rule. The default stylesheet switches to it at 40rem and under. Unstyled, both trails render with data-crumbs="wide" and "narrow", and the site shows one.structuredData writes a schema.org BreadcrumbList with every level, hidden ones and the current page included. Pass origin to make links absolute.Breadcrumbs works on its own too, outside the browser, for any page with a trail (pass crumbs, indexPages and current). The plan itself is plain TypeScript in …/core: planCrumbs, breadcrumbJsonLd.
Icons and silhouettes. For a one-color SVG icon, return { image, imageAlt, imageMask: true } from describe. The browser draws it as a mask in --ndb-color-image, so it takes the theme's color in light and dark. With imageAlt ("No photo yet (tortoise)") it's announced; without it, it's decorative. unstyled shows it as a plain picture.
// Theme tokens for the whole site (or just --ndb-* for this browser):
<div style={{ '--palette-primary': '#2f6b3a', '--palette-surface-raised': '#f4f1e6', '--palette-radius-lg': '0px' }}>
<NestedDocsBrowser data={data} noun="families" classNames={{ title: 'my-title', card: 'my-card' }} />
</div>
The stylesheet renders with the component. To import it instead, use @extantape/payload-plugin-nested-docs-browser/client/styles.css and pass includeStyles={false}. For a CSP, pass nonce.
npm test # Vitest: core, Payload side (in-memory MongoDB), views (jsdom)
npm run typecheck
npm run build
MIT
nested docs
Official plugin for nesting Payload documents inside one another
100151.9k/wk46.1kv3 v4
payload page tree
Folder-based hierarchical URL slugs with a visual page tree in the Payload admin
81536/wk19v3
payload slug
Slug field with Auto/Manual modes, nested source paths, localization and enforced uniqueness
802.4k/wk0v3
payload nested docs page tree
Page tree list view for nested docs collections with drag and drop, status badges and live or preview links
771.6k/wk35v3
path
Stored, indexed URL paths for Payload 4 pages and posts built from a parent and a slug
75270/wk10v4
redirects
Editor-managed redirects for Payload 4 with indexed lookups, regex support and move-based redirect suggestions
72187/wk10v4