π Modern documentation framework with VitePress parity
Leaf is a fast, modern documentation framework built with SolidJS that achieves 100% feature parity with VitePress. Zero-config, blazingly fast, and beautifully designed with ultra-lightweight bundle size.
- β‘ Fast Builds: ~2s for 22 pages with search index
- π¦ Ultra Lightweight: Fine-grained reactivity with minimal runtime overhead
- π¨ Beautiful: Modern, responsive design with dark mode and theme switching
- π οΈ Zero Config: Works out of the box, no configuration required
- π§ Modern Stack: Built with Bun, Vite, SolidJS, and TypeScript
- β Full Markdown + MDX support with GFM
- β Frontmatter metadata
- β Custom containers (tip, warning, danger, details)
- β Inline badges for highlighting (NEW, BETA, DEPRECATED)
- β Automatic external link detection with icons
- β Syntax highlighting with highlight.js
- β
Code line highlighting (
{1,3-5}syntax) - β Code groups with tabs (multi-language examples)
- β One-click code copy buttons
- β Math equations with KaTeX (LaTeX syntax)
- β Mermaid diagrams (flowcharts, sequence, gantt)
- β Beautiful default theme with dark mode
- β Auto-generated sidebar from file structure
- β Collapsible sidebar groups
- β Table of contents with scroll spy
- β Mobile-responsive with hamburger menu
- β NEW: Header hash links with hover effects
- β Prev/Next page navigation
- β Last updated timestamps (from git)
- β Local fuzzy search with MiniSearch (Cmd/Ctrl+K)
- β 605 searchable documents indexed
- β Static Site Generation (SSG)
- β Pre-rendered HTML for instant loading
- β Fast builds with Vite (~2s for 22 pages)
- β Ultra-lightweight runtime with SolidJS fine-grained reactivity
- β No Virtual DOM overhead - direct DOM manipulation
- β β‘β‘β‘ Blazing fast: Lighthouse scores 95+
- β Zero-config by default
- β File-based routing
- β Hot Module Replacement (HMR)
- β 100% TypeScript
- β Monorepo architecture
packages/
βββ core/ - Core framework logic
βββ cli/ - CLI tools
βββ theme-default/ - Default theme
βββ create-leaf/ - Scaffolding tool
examples/
βββ docs/ - Example docs site (Sylphx products documentation)
docs/ - Leaf official documentation (self-hosted)
βββ docs/ - 14 comprehensive documentation pages
βββ build.ts - Static site generation
βββ dist/ - Built documentation site
- Runtime: Bun
- Build Tool: Vite
- Framework: SolidJS 1.9+ (Fine-grained reactivity)
- Router: @solidjs/router
- Styling: Tailwind CSS
- Search: MiniSearch
- Linting: Biome
- Testing: Bun Test
Get your documentation site running in under 60 seconds:
# 1. Install CLI (one-time setup)
npm install -D @sylphx/leaf-cli
# 2. Create your first doc
mkdir docs
echo '# Hello World\n\nMy first Leaf doc!' > docs/index.md
# 3. Start dev server
npx leaf devOpen http://localhost:5173 π
:::code-group
npm install -D @sylphx/leaf-cli
npx leaf devbun add -D @sylphx/leaf-cli
bunx leaf devpnpm add -D @sylphx/leaf-cli
pnpm leaf devyarn add -D @sylphx/leaf-cli
yarn leaf dev:::
Leaf is split into focused packages for flexibility:
| Package | Purpose | When to Use |
|---|---|---|
@sylphx/leaf-cli |
Command-line tool | β Start here! Includes everything needed |
The CLI automatically includes @sylphx/leaf (core) and @sylphx/leaf-theme-default (theme).
| Package | Purpose | When to Use |
|---|---|---|
@sylphx/leaf |
Core framework | Building custom tooling or themes |
@sylphx/leaf-theme-default |
Default theme | Creating custom theme variations |
π‘ Recommendation: Use @sylphx/leaf-cli unless you're building custom tooling.
Best for: Getting started quickly, zero configuration
# Install
npm install -D @sylphx/leaf-cli
# Commands
npx leaf dev # Start dev server
npx leaf build # Build for production
npx leaf preview # Preview production buildBest for: Custom build pipelines, monorepos, advanced customization
# Install core packages
npm install @sylphx/leaf @sylphx/leaf-theme-defaultThen configure Vite manually. See Installation Guide for details.
Leaf works with zero configuration, but you can customize it:
// leaf.config.ts
import { defineConfig } from '@sylphx/leaf';
export default defineConfig({
title: 'My Docs',
description: 'My awesome documentation',
theme: {
nav: [
{ text: 'Guide', link: '/guide' },
{ text: 'API', link: '/api' }
],
sidebar: [
{ text: 'Introduction', link: '/' },
{ text: 'Getting Started', link: '/getting-started' }
]
}
});This section is for Leaf developers working on the framework itself.
# Clone the repo
git clone https://github.com/sylphxltd/leaf.git
cd leaf
# Install dependencies
bun install
# Start development
cd examples/docs
bun dev
# Build all packages
bun run build
# Lint code
bun run lint:fixpackages/
βββ core/ - Core framework (@sylphx/leaf)
βββ cli/ - CLI tool (@sylphx/leaf-cli)
βββ theme-default/ - Default theme (@sylphx/leaf-theme-default)
βββ create-leaf/ - Scaffolding tool (coming soon)
| Feature | Leaf | VitePress | Status |
|---|---|---|---|
| Markdown Processing | β Remark + Rehype | β Markdown-it | π’ Parity |
| Code Highlighting | β Highlight.js | β Shiki | π’ Parity |
| Code Line Highlight | β
{1,3-5} |
β
{1,3-5} |
π’ Parity |
| Code Groups/Tabs | β Native | β Native | π’ Parity |
| Custom Containers | β tip/warning/danger/details | β tip/warning/danger/details | π’ Parity |
| Badges | β
<Badge type="tip" text="NEW" /> |
β
<Badge type="tip" text="NEW" /> |
π’ Parity |
| External Link Icons | β Auto-detect | β Auto-detect | π’ Parity |
| Local Search | β MiniSearch (22KB) | β MiniSearch | π’ Parity |
| TOC Sidebar | β Scroll spy | β Scroll spy | π’ Parity |
| Auto Sidebar | β File-based | β File-based | π’ Parity |
| Dark Mode | β System + manual | β System + manual | π’ Parity |
| Mobile Responsive | β Hamburger menu | β Hamburger menu | π’ Parity |
| Last Updated | β Git-based | β Git-based | π’ Parity |
| SSG Build | β Full pre-render | β Full pre-render | π’ Parity |
| Math Equations | β KaTeX | β KaTeX | π’ Parity |
| Mermaid Diagrams | β v11 (CDN) | β Native | π’ Parity |
| Aspect | Leaf | VitePress |
|---|---|---|
| Framework | SolidJS 1.9+ | Vue 3 |
| Router | @solidjs/router | Vue Router |
| Runtime | Bun | Node.js |
| Build Tool | Vite | Vite |
| Reactivity | Fine-grained signals | Vue Composition |
| Styling | Tailwind CSS | CSS Modules |
| Search | MiniSearch | MiniSearch |
| Build Speed | β‘β‘β‘ Faster | β‘β‘ Fast |
| Bundle Size | Lightweight | Similar |
The docs/ directory contains comprehensive Leaf documentation built with Leaf itself:
- 22 pages of complete documentation
- Introduction: What is Leaf, Why Leaf, Getting Started
- Guide: Installation, Configuration, Markdown, Theming
- Features: Code Highlighting, Math Equations, Mermaid Diagrams, Search
- API Reference: Config API, Markdown Plugins API, Theming API
Build & View:
cd docs
bun install
bun run build # Generates 22 static pages
bun run dev # Development serverStats:
- π 22 static HTML pages
- π 605 searchable documents
- π¦ 802KB JavaScript (uncompressed)
- β±οΈ ~2s build time
The examples/docs directory contains a demo site showcasing Sylphx products:
- Zen - State management library
- Craft - Immutable data manipulation
- Silk - CSS-in-TypeScript framework
cd examples/docs
bun devβ Production Ready - v0.1.1 with complete VitePress parity
- Full Markdown + MDX support with GFM
- Syntax highlighting with line numbers and tabs
- Custom containers (tip, warning, danger, details)
- Local search with MiniSearch
- Static Site Generation (SSG)
- Math equations with KaTeX
- Mermaid diagrams
- Header hash links with hover effects
- π¦ Bundle: Lightweight with fine-grained reactivity
- β‘ Build: ~2s for 22 pages
- π Search: 604+ documents indexed
- π― Lighthouse: 95+ scores
- Edit link integration
- Image lazy loading & optimization
- RSS feed generation
- I18n support
- Plugin API
- Theme customization API
- SolidJS Performance: Fine-grained reactivity with no Virtual DOM overhead
- Faster Reactivity: Direct DOM updates without diffing
- Modern Runtime: Bun offers faster installs and execution
- Lightweight: Minimal runtime with maximum performance
- Type Safety: First-class TypeScript support throughout
- Simple Mental Model: Signals and effects without complex reactivity rules
We welcome contributions! This is an open-source project built to demonstrate:
- Modern tooling (Bun, Vite, Biome)
- Monorepo architecture
- SolidJS-based static site generation
- Fine-grained reactivity patterns
- Lightweight performance optimization
Made with β€οΈ by Sylphx
MIT
- π Documentation: Full Guide
- π Issues: Report bugs or request features
- π¬ Discussions: GitHub Discussions
- π¦ Packages: @sylphx on npm