zudo-doc
GitHub repository

Type to search...

to open search from anywhere

CategoryTreeNav

Created Mar 16, 2026Updated Jun 7, 2026Takeshi Takatsudo

A server-rendered Preact component that renders a nested tree of child page links for category index pages.

Overview

CategoryTreeNav is a server-rendered Preact component that displays child pages of a category as a nested tree of links (ul > li > ul > li pattern). It is an alternative to CategoryNav which uses a card-grid style — CategoryTreeNav is more compact and suited to categories with deeper nesting.

Info

CategoryTreeNav is globally available in all MDX doc pages — no import needed. It is registered alongside the admonition components (Note, Tip, etc.) in the doc page route.

Live Example

Here is CategoryTreeNav rendering the Guides category:

Usage

Use CategoryTreeNav in a category's index.mdx to create a compact tree-style listing:

---
title: Getting Started
sidebar_position: 0
---

Welcome to the Getting Started section.

<CategoryTreeNav category="getting-started" />

CategoryTreeNav renders entirely on the server with zero client-side JavaScript — no hydration directive is needed.

Comparison with CategoryNav

FeatureCategoryNavCategoryTreeNav
Layout2-column card gridNested tree list
DescriptionShown in each cardShown inline after title
NestingFlat (children only)Unlimited (maxDepth defaults to Infinity)
Best forLanding pages, overviewsDeep hierarchies, compact listings

Props

PropTypeDefaultDescription
categorystring(required)The category slug (e.g., "guides", "reference")
langLocaleauto-detectedOverride the locale for the content collection

The lang prop is automatically detected from the current URL path, so you typically don't need to set it.

Source

The component is defined at pages/lib/_category-tree-nav.tsx.

Revision History

Takeshi TakatsudoCreated: 2026-03-16T22:41:53+09:00Updated: 2026-06-07T16:19:05+09:00

AI Assistant

Ask a question about the documentation.