Pages
Node views, header, tree, breadcrumb and backlinks for host-owned sub-pages.
These components render a PageStore. All except the node views work with no
editor mounted. There is no isolated preview; see them together in the
playground.
Node views
bunx --bun shadcn@latest add @slash-editor/page-node-viewsSubPageNodeView and PageLinkNodeView render the subPage block and pageLink inline node. They
read { store, onNavigate } from the kit's pages option, show the live title, and display a
skeleton while loading and a "missing / in trash" state otherwise. Attach them with the nodeViews
option:
pages: {
store,
currentPageId: pageId,
onNavigate,
nodeViews: {
subPage: ReactNodeViewRenderer(SubPageNodeView),
pageLink: ReactNodeViewRenderer(PageLinkNodeView),
},
}Page header
bunx --bun shadcn@latest add @slash-editor/page-headerIcon, cover and title for one page, rendered outside EditorContent. Edits go to store.update.
Enter or ArrowDown in the title moves focus to the document start; ArrowUp at the document start
moves it back.
| Prop | Type | Description |
|---|---|---|
store | PageStore | Source of the title, icon and cover. |
pageId | string | Page to edit. |
editor | Editor | null | Receives focus on Enter/ArrowDown. |
className | string | Merged onto the root. |
focusPageTitle() focuses the title input — call it after creating a page to start typing.
Page tree
bunx --bun shadcn@latest add @slash-editor/page-treeA lazily expanded tree built on usePageTree; children load through store.listChildren on first
expand and refresh when the store notifies.
| Prop | Type | Description |
|---|---|---|
store | PageStore | Page directory. |
activePageId | string | null | Highlighted row. |
rootId | string | null | Parent whose children are the top rows. Default null. |
onNavigate | (pageId: string) => void | Called when a row is chosen. |
onCreate | () => void | Called from the header's New page button. |
defaultExpanded | string[] | Ids expanded on first render. |
className | string | Merged onto the root. |
Breadcrumb
bunx --bun shadcn@latest add @slash-editor/page-breadcrumbAncestors of a page, root first, built on useBreadcrumb.
| Prop | Type | Description |
|---|---|---|
store | PageStore | Page directory. |
pageId | string | Last crumb. |
onNavigate | (pageId: string) => void | Called when a crumb is chosen. |
className | string | Merged onto the root. |
Backlinks
bunx --bun shadcn@latest add @slash-editor/page-backlinksPages that reference this one, built on useBacklinks. Needs store.backlinks; renders nothing
useful without it. See Backlinks for the index recipe.
| Prop | Type | Description |
|---|---|---|
store | PageStore | Page directory. |
pageId | string | Page whose referrers are listed. |
onNavigate | (pageId: string) => void | Called when an entry is chosen. |
className | string | Merged onto the root. |