EmcyDocs

Layouts

Classic Docs Layout

The standard sidebar + content + TOC layout for documentation sites.

5 sections3 locales

The classic docs layout provides the familiar three-column documentation experience.

When to use#

Choose this layout when you need:

  • Full sidebar navigation for browsing docs
  • Table of contents for long pages
  • Previous and next pagination
  • Search in the header

This is the most common layout for:

  • Developer documentation
  • API references
  • Technical guides
  • Product manuals

Features#

FeatureIncluded
Sidebar navigationYes
Table of contentsYes
Mobile drawerYes
SearchYes
Previous/next linksYes
Section collapsingYes

Usage#

TSX
import { DocsLayout, DocsPage } from "@emcy/docs";
import "@emcy/docs/styles.css";
 
// In your layout.tsx
export default function Layout({ children }) {
  return (
    <DocsLayout
      navigation={docsSource.getNavigation()}
      brand={<span>My Docs</span>}
      languageSwitcher={<LanguageSwitcher locales={["en", "es", "zh"]} />}
      searchAction={search}
    >
      {children}
    </DocsLayout>
  );
}
 
// In your page.tsx
export default function Page() {
  const { entry, previousEntry, nextEntry } = docsSource.resolveRoute(slug);
 
  return (
    <DocsPage
      entry={entry}
      previousEntry={previousEntry}
      nextEntry={nextEntry}
    />
  );
}

Layout props#

PropTypeDescription
navigationDocsNavSection[]Sidebar navigation structure
brandReactNodeLogo or brand for the header
topLinksDocsLayoutLink[]Links in the header
headerReactNode | ((props) => ReactNode) | nullReplace the default docs header or remove it entirely
sidebarReactNode | ((props) => ReactNode) | nullReplace the default docs sidebar or remove it entirely
languageSwitcherReactNodeOptional language switcher slot in the shared shell
themeSwitcherReactNodeOptional theme switcher slot in the shared shell
themeDocsThemeConfigPreset, mode, density, accent, radius, and shell sizing
searchActionDocsSearchActionServer action for search

Try it#

You are viewing this layout right now at docs.

Use Theme configuration to restyle the same layout, or Custom header and sidebar when you need to substitute the chrome.