Project structure

Understand where content, routes, and interface components live.

Gridlines separates content from presentation. Writers mostly work in MDX files, while designers and developers customize the shared components and theme.

Top-level folders

This tree shows where routes, reusable components, and content live in the project.

src
app
docs
[[...slug]]
page.tsx
components
docs
sidebar.tsx
toc.tsx
navigation.tsx
content
docs
mdx-components.tsx

Content

Docs pages live in src/content/docs. This folder is the main surface area for writers.

Components

The docs sidebar, table of contents, navigation, and MDX component map are normal React components. Customize them like the rest of your app.

Route structure

Routes define how content becomes pages. Keep route files small and let shared components handle repeated layout details.

Docs route

The docs route should load the current page, render its MDX body, and pass navigation data to sidebar and table of contents components.

Component structure

Shared components are the right place for reusable UI decisions. Put repeated prose styling, image handling, code tabs, and install commands behind stable component APIs.

Local ownership

Keep docs-specific components near the docs experience and general UI primitives in the shared UI folder. This makes future changes easier to locate.

Was this page helpful?