Navigation
Zudoku uses a single navigation array to control both the top navigation tabs and the sidebar.
Items at the root of this array appear as tabs, and nested items build the sidebar tree. Navigation
entries can be links, document references, categories, custom pages, separators, sections, or
filters.
Basic configuration
The navigation is defined using the navigation array in the Zudoku config file. Each item can be
one of several types. At the simplest level you may only have links and categories.
zudoku.config.tsx
Navigation Items
Navigation items can be of these types: category, doc, link, custom-page, separator,
section, or filter.
link: A direct link to a page or external URL.category: A group of links that can be expanded or collapsed.doc: A reference to a document by its file path:file.custom-page: A custom page that is made of a React component, see Custom Pagesseparator: A horizontal line to visually divide sidebar items.section: A non-interactive heading label to group sidebar items.filter: An inline search input that filters navigation items. Multiple filter inputs share the same search query.
type: link
link is the most basic item, it directly links to a path or URL. Use this for external resources
or standalone pages.
Code
TypeScript type declaration
Code
type: category
The category type groups related items under a collapsible section. The label is the displayed
text, and the items array can contain any navigation item type (documents, links, categories,
custom pages, separators, sections, and filters).
Code
TypeScript type declaration
Code
Category links
A category can have a link property that makes the category label itself clickable, navigating to
a document. This is useful when you want a category that acts as both a group and a landing page.
The link can be a simple string pointing to a file path, or an object for more control:
String shorthand
Object form with custom path
The object form supports these properties:
| Property | Type | Description |
|---|---|---|
type | "doc" | Must be "doc" |
file | string | Path to the markdown file |
label | string | Override the label (defaults to the document title) |
path | string | Custom URL path (overrides the default file-based route) |
type: doc
Doc is used to reference markdown files. The label is the text that will be displayed, and the
file is the file path associated with a markdown file.
Code
TypeScript type declaration
Code
Using shorthands
Documents can be referenced as strings (using their file path), which is equivalent to
{ "type": "doc", "file": "path" }:
Code
This is much more concise when you don't need custom labels, icons, or other properties for individual documents.
Learn more in the Markdown documentation
Custom paths
The path property allows you to customize the URL path for a document. By default, Zudoku uses the
file path to generate the URL, but you can override this behavior by specifying a custom path.
Serving a doc at the root URL
Custom slug
When a file has a custom path, it will only be accessible at that custom path, not at its original file-based path. See Documentation - Custom Paths for more details.
Avoid naming files index.md or index.mdx and relying on their default path. Some hosting
providers (e.g. Vercel) automatically strip /index from URLs with a redirect, which can cause
routing issues. Instead, give files descriptive names and use the path property to serve them at
the desired URL.
type: custom-page
Custom pages allow you to create standalone pages that are not tied to a Markdown document. This is useful for creating landing pages, dashboards, or any other custom content.
Code
TypeScript type declaration
Code
Set layout: "none" to render the page without the default Zudoku layout (header, sidebar, footer).
This is useful for fully custom landing pages.
type: separator
A visual divider line in the sidebar. Use separators to create visual breaks between groups of items.
Code
TypeScript type declaration
Code
type: section
A non-interactive heading label in the sidebar. Sections are rendered as small uppercase text and are useful for labeling groups of items without adding a collapsible wrapper.
Code
TypeScript type declaration
Code
type: filter
An inline search input that updates the shared navigation filter. When the user types, the query is applied across the sidebar so that only matching items remain visible.
Code
TypeScript type declaration
Code
Display Control
All navigation items support a display property that controls when the item should be visible:
"always"(default): Always visible"auth": Only visible when user is authenticated"anon": Only visible when user is not authenticated"hide": Never visible (useful for temporarily hiding items)- callback function: For custom logic, pass a function that receives
{ context, auth }and returns a boolean
Code
Custom Display Logic
For more complex visibility rules, use a callback function:
Code
The callback receives:
context: TheZudokuContextinstanceauth: The authentication state fromUseAuthReturn, includinguser,isAuthenticated, etc.
Badges
Navigation items can display badges with labels and colors. Badges support an optional invert
property for styling:
Code
Icons
Icons can be added to categories and documents by specifying an icon property. The value should be
the name of a Lucide icon (e.g., book , code ,
file-text ).
Code
They can also be set on individual documents in their front matter:
Code
Title & Labels
All navigation items can have a label property that determines the displayed text. For doc
items, the label is optional; if omitted, Zudoku uses the document's title from its front matter
or the first # header.
To override the navigation label without changing the document's title, use the sidebar_label
property in the front matter:
Code
In this example, the document's title remains "My Long Title," but the sidebar displays "Short Title."
For the complete list of supported frontmatter properties, see Frontmatter.
Common Patterns
Serving a document at the root URL
To make a markdown document accessible at /, use the path property to override the default
file-based route:
Standalone root doc
Category with root landing page
Landing page with hidden tab
Use a custom-page with display: "hide" and layout: "none" to create a full-page landing
experience that doesn't appear in the navigation tabs:
Code
Organized sidebar with sections and separators
Combine section, separator, and filter items to create a well-structured sidebar:
Code
Navigation Rules
Plugins generate sidebar navigation automatically (e.g. from OpenAPI tags). Navigation rules let you
customize that generated sidebar by inserting, modifying, sorting, moving, or removing items. To
change the top-level tabs themselves, use the navigation array directly.
Code
For a practical walkthrough with more examples, see the Navigation Rules guide.
Rule Types
Each rule has a type and a match property that targets a navigation item.
| Type | Description |
|---|---|
insert | Add items before or after a matched item |
modify | Change label, icon, badge, collapsed, collapsible, or display |
remove | Remove a matched item from the sidebar |
sort | Sort children of a matched category using a custom comparator |
move | Relocate a matched item before or after another item |
Match Syntax
The match property uses slash-separated segments to target items. The first segment identifies the
top-level tab by label, and remaining segments navigate into the sidebar tree. Label matching is
case-insensitive.
Code