A minimal, modern, and elegant documentation website template built with React, TanStack Start, and Tailwind CSS.
- ✨ Minimal & Modern Design - Clean, distraction-free interface focused on content
- 📱 Fully Responsive - Works seamlessly on desktop, tablet, and mobile devices
- 🎨 Dark Mode Support - Built-in theme switching
- 📚 Multi-level Navigation - Collapsible sidebar navigation with nested items
- 📑 Auto-generated TOC - "On This Page" navigation with scroll spy
- 💻 Code Highlighting - Beautiful code blocks with copy-to-clipboard
- 🎯 Centered Layout - Max-width content for optimal readability
- ⚡ Fast & Performant - Built with modern React and optimized for speed
- 🔍 SEO Friendly - Semantic HTML structure
- ♿ Accessible - WCAG compliant components
- Node.js 18+ or Bun
- Basic knowledge of React and TypeScript
The documentation components are already set up in this project. To use them in your pages:
import { DocsLayout, DocsContent } from '@/components/docs'
function MyDocPage() {
return (
<DocsLayout title="My Documentation">
<DocsContent>
<h1>Getting Started</h1>
<p>Welcome to my documentation!</p>
</DocsContent>
</DocsLayout>
)
}The main layout component that provides the documentation structure.
Props:
title(string, optional) - The site title displayed in the header. Default: "Documentation"navItems(NavItem[], optional) - Custom navigation structurechildren(ReactNode) - The page content
Example:
<DocsLayout title="My Docs" navItems={customNavItems}>
{/* Your content */}
</DocsLayout>A wrapper component that applies proper typography and styling to documentation content.
Props:
children(ReactNode) - The documentation contentclassName(string, optional) - Additional CSS classes
Example:
<DocsContent>
<h1>Page Title</h1>
<p>Your content here...</p>
</DocsContent>Multi-level navigation component with collapsible sections.
Props:
items(NavItem[], optional) - Navigation structure. Uses default navigation if not provided.
NavItem Interface:
interface NavItem {
title: string
href?: string
items?: NavItem[]
disabled?: boolean
}Example:
const navItems = [
{
title: 'Getting Started',
items: [
{ title: 'Introduction', href: '/' },
{ title: 'Installation', href: '/installation' },
],
},
{
title: 'Components',
items: [
{ title: 'Overview', href: '/components' },
{
title: 'UI Components',
items: [
{ title: 'Buttons', href: '/components/buttons' },
{ title: 'Forms', href: '/components/forms' },
],
},
],
},
]
<DocsNavigation items={navItems} />Table of contents component with scroll spy functionality. Automatically generates TOC from h2, h3, and h4 headings.
Props:
items(TocItem[], optional) - Manual TOC items. Auto-generates if not provided.
Example:
<DocsToc />Callout/alert component for highlighting important information.
Props:
type('info' | 'warning' | 'danger' | 'success') - Callout type. Default: 'info'title(string, optional) - Callout titlechildren(ReactNode) - Callout content
Example:
<DocsCallout type="warning" title="Important">
This is a warning message.
</DocsCallout>Code block component with syntax highlighting and copy functionality.
Props:
children(string) - The code contentlanguage(string, optional) - Programming language. Default: 'typescript'title(string, optional) - Code block titleshowLineNumbers(boolean, optional) - Show line numbers. Default: false
Example:
<DocsCodeBlock language="javascript" title="example.js" showLineNumbers>
{`function hello() {
console.log('Hello, World!')
}`}
</DocsCodeBlock>Inline code component for code within text.
Example:
<p>
Use the <InlineCode>useState</InlineCode> hook for state management.
</p>To customize the navigation, create a navigation configuration file:
// src/config/navigation.ts
import type { NavItem } from '@/components/docs'
export const navItems: NavItem[] = [
{
title: 'Getting Started',
items: [
{ title: 'Introduction', href: '/' },
{ title: 'Installation', href: '/installation' },
],
},
// Add more sections...
]Then pass it to the DocsLayout:
import { navItems } from '@/config/navigation'
;<DocsLayout navItems={navItems}>{/* content */}</DocsLayout>The documentation components use Tailwind CSS for styling. You can customize the appearance by:
- Modifying Tailwind theme - Edit
src/styles.cssto change colors, fonts, etc. - Extending components - Create wrapper components with custom styles
- Using className prop - Most components accept a
classNameprop for additional styling
- Create a new route file in
src/routes/_public/ - Use the DocsLayout and DocsContent components
- Add the page to your navigation structure
Example:
// src/routes/_public/installation.tsx
import { createFileRoute } from '@tanstack/react-router'
import { DocsLayout, DocsContent } from '@/components/docs'
export const Route = createFileRoute('/_public/installation')({
component: Installation,
})
function Installation() {
return (
<DocsLayout title="Minimal Docs">
<DocsContent>
<h1>Installation</h1>
<p>Follow these steps to install...</p>
</DocsContent>
</DocsLayout>
)
}- Use clear headings - Structure your content with h2, h3, and h4 headings
- Add IDs to headings - For better TOC generation:
<h2 id="section-name">Section Name</h2> - Include code examples - Show, don't just tell
- Use callouts - Highlight important information with DocsCallout components
- Keep paragraphs short - Improve readability with concise paragraphs
- Add tables - Use tables for structured data like API references
- Start with overview - Begin each section with a brief introduction
- Progress from simple to complex - Build up knowledge gradually
- Group related topics - Use navigation sections to organize content
- Cross-reference - Link to related sections when appropriate
- Update regularly - Keep documentation in sync with code changes
- Use semantic HTML - Proper heading hierarchy (h1 → h2 → h3)
- Add alt text - Describe images for screen readers
- Ensure contrast - Text should be readable in both light and dark modes
- Keyboard navigation - All interactive elements should be keyboard accessible
src/
├── components/
│ └── docs/
│ ├── docs-layout.tsx # Main layout component
│ ├── docs-navigation.tsx # Navigation sidebar
│ ├── docs-toc.tsx # Table of contents
│ ├── docs-content.tsx # Content wrapper with styling
│ ├── docs-callout.tsx # Callout/alert component
│ ├── docs-code-block.tsx # Code block component
│ ├── docs-mobile-nav.tsx # Mobile navigation
│ └── index.ts # Exports
├── routes/
│ └── _public/
│ └── index.tsx # Home/overview page
└── styles.css # Global styles
- React 19 - UI library
- TanStack Start - Full-stack React framework
- TanStack Router - Type-safe routing
- Tailwind CSS v4 - Utility-first CSS framework
- shadcn/ui - Re-usable component library
- TypeScript - Type safety
- Lucide React - Icon library
- Chrome (latest)
- Firefox (latest)
- Safari (latest)
- Edge (latest)
To contribute to this documentation template:
- Fork the repository
- Create a feature branch
- Make your changes
- Test thoroughly
- Submit a pull request
This project is open source and available under the MIT License.
For issues, questions, or suggestions:
- Open an issue on GitHub
- Check existing documentation
- Review the example pages
Built with ❤️ using React and TanStack Start