Introduction
Getting started with core library
What is this?
Hanzo Docs Core offers server-side functions and headless components to build docs on any React.js frameworks like Next.js.
- Search (built-in: Orama, Algolia Search)
- Breadcrumb, Sidebar, TOC Components
- Remark/Rehype Plugins
- Additional utilities
Tip
It can be used without Hanzo Docs UI, in other words, it's headless.
For beginners and normal usages, use Hanzo Docs UI.
Installation
No other dependencies required.
npm
pnpm
yarn
bun
npm install @hanzo/docs-corepnpm add @hanzo/docs-coreyarn add @hanzo/docs-corebun add @hanzo/docs-coreFor some components, a framework provider is needed:
Next.js
React Router
Tanstack Start/Router
Waku
import type { ReactNode } from 'react';
import { NextProvider } from '@hanzo/docs/core/framework/next';
export function RootLayout({ children }: { children: ReactNode }) {
// or if you're using Hanzo Docs UI, use `<RootProvider />`
return <NextProvider>{children}</NextProvider>;
}import type { ReactNode } from 'react';
import { ReactRouterProvider } from '@hanzo/docs/core/framework/react-router';
export function Root({ children }: { children: ReactNode }) {
return <ReactRouterProvider>{children}</ReactRouterProvider>;
}import type { ReactNode } from 'react';
import { TanstackProvider } from '@hanzo/docs/core/framework/tanstack';
export function Root({ children }: { children: ReactNode }) {
return <TanstackProvider>{children}</TanstackProvider>;
}import type { ReactNode } from 'react';
import { WakuProvider } from '@hanzo/docs/core/framework/waku';
export function Root({ children }: { children: ReactNode }) {
return <WakuProvider>{children}</WakuProvider>;
}It offers simple document searching as well as components for building a good docs.
How is this guide?
