Skip to main content

Examples & Showcase

Learn from real-world VitePress implementations and explore sites built with VitePress.

Official Examples

VitePress Documentation

The official VitePress documentation site - the best reference implementation.

Vue.js Documentation

The official Vue.js documentation, built with VitePress.

Vite Documentation

Vite’s official documentation site using VitePress.

Vitest Documentation

Vitest testing framework documentation.

Getting Started Examples

Basic Site Setup

A minimal VitePress site structure:
package.json:
docs/.vitepress/config.ts:

Home Page with Hero

docs/index.md:

Custom Theme Example

Extending the default theme: docs/.vitepress/theme/index.ts:
docs/.vitepress/theme/custom.css:

Advanced Examples

Multi-language Site

config.ts:
Directory structure:

Dynamic Routes with Data Loading

docs/.vitepress/config.ts:
docs/posts/[id].md:

Content Collections with createContentLoader

docs/.vitepress/theme/posts.data.ts:
Use in a page:

Algolia DocSearch Integration

config.ts:

Local Search Implementation

config.ts:

Real-world Sites Built with VitePress

Vue.js

Progressive JavaScript Framework documentation

Vite

Next Generation Frontend Tooling

Vitest

Blazing Fast Unit Test Framework

Rollup

JavaScript module bundler

UnoCSS

Instant On-demand Atomic CSS Engine

Pinia

The Vue Store that you will enjoy using

Code Examples

Using Vue Components in Markdown

docs/.vitepress/theme/components/Counter.vue:
docs/guide/example.md:

Custom Markdown Container

config.ts:
Use in markdown:

Syntax Highlighting with Shiki

config.ts:
In markdown:

Project Templates

Minimal Template

Quickly scaffold a new VitePress site:
Follow the prompts to set up:
  • Installation directory
  • Site title
  • Description
  • Default theme customization

Monorepo Setup

For projects with multiple packages:
package.json (root):

Tips & Best Practices

For large documentation sites:
Improve SEO with proper meta tags:
Create a branded 404 experience:docs/.vitepress/theme/NotFound.vue:

Learning Resources

Have a VitePress site you’d like to showcase? Share it in the VitePress discussions!