Skip to content

๐Ÿš€ Modern Vue 3 documentation framework - Create beautiful docs websites with YAML configuration and Markdown rendering. Zero setup, fully responsive, with dark/light themes.

License

Notifications You must be signed in to change notification settings

shenjianZ/vue-docs-ui

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

36 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Vue Docs UI

npm version License: MIT Vue.js TypeScript

ไธญๆ–‡ๆ–‡ๆกฃ

A modern, feature-rich documentation UI component library built with Vue 3. Create beautiful documentation websites with YAML configuration and Markdown rendering - ready to use out of the box.

โœจ Features

  • ๐ŸŽจ Modern Design: Grid-based responsive layout with beautiful UI
  • ๐Ÿ“ฑ Mobile Optimized: Perfect mobile experience with touch-friendly navigation
  • ๐ŸŒˆ Multi-Theme System: 6 beautiful preset themes (Default, Vue, GitHub, Purple, Orange, Emerald)
  • ๐ŸŒ™ Smart Theme Mode: Light/dark mode with auto system preference detection
  • ๐Ÿ“– Markdown Rendering: Complete Markdown support with syntax highlighting
  • ๐Ÿ” Auto Navigation: Automatic table of contents generation
  • โš™๏ธ YAML Configuration: Configuration-driven approach with YAML files
  • ๐Ÿš€ Zero Setup: Get started with just 3 lines of code
  • ๐Ÿ“Š TypeScript: Full TypeScript support with type definitions
  • ๐ŸŽฏ Vue 3: Built for Vue 3 with Composition API
  • ๐Ÿ”ง Highly Customizable: Flexible theming and component customization

๐Ÿš€ Quick Start

Option 1: Use Scaffolding Tool (Recommended)

# Create a new documentation project with one command
npm create vue-docs-ui my-docs
cd my-docs
npm install
npm run dev

Option 2: Manual Installation

npm install vue-docs-ui
# or
yarn add vue-docs-ui
# or
pnpm add vue-docs-ui

Basic Usage (3 lines of code!)

// main.ts
import createDocsApp from 'vue-docs-ui'
import 'vue-docs-ui/dist/style.css'

createDocsApp()

Configuration File

Create public/config/site.yaml:

# Basic site configuration
site:
  title: "My Documentation"
  description: "Built with Vue Docs UI"
  logo: "๐Ÿ“š"  # Supports emoji, images, or URLs
  author: "Your Name"

# Navigation
navbar:
  items:
    - title: "Home"
      link: "/"
    - title: "Guide"
      link: "/guide"
    - title: "GitHub"
      link: "https://github.com/your-repo"
      external: true

# Sidebar
sidebar:
  sections:
    - title: "Getting Started"
      path: "/guide"
      children:
        - title: "Quick Start"
          path: "/guide/quick-start"
        - title: "Configuration"
          path: "/guide/configuration"

# Theme (NEW: Multi-theme support!)
theme:
  # Theme selection: default | vue | github | purple | orange | emerald
  theme: "vue"
  
  # Default mode: light | dark | auto
  defaultMode: "auto"
  
  # Allow users to toggle theme
  allowToggle: true
  
  # Show theme switcher component
  showThemeSwitcher: true

# Table of Contents
toc:
  maxLevel: 2
  enabled: true
  title: "Contents"

Add Markdown Content

Create your markdown files in public/docs/:

public/
โ”œโ”€โ”€ config/
โ”‚   โ””โ”€โ”€ site.yaml
โ””โ”€โ”€ docs/
    โ”œโ”€โ”€ guide/
    โ”‚   โ”œโ”€โ”€ quick-start.md
    โ”‚   โ””โ”€โ”€ configuration.md
    โ””โ”€โ”€ advanced/
        โ””โ”€โ”€ customization.md

That's it! ๐ŸŽ‰ Run npm run dev and your documentation site is ready.

๐Ÿ“ฆ What's Included

  • DocsLayout: Main layout component with responsive design
  • HeaderNav: Top navigation with theme toggle and mobile menu
  • SidebarNav: Collapsible sidebar navigation
  • TableOfContents: Auto-generated table of contents
  • MarkdownRenderer: Markdown rendering with syntax highlighting
  • DefaultHome: Beautiful homepage component
  • DefaultArticle: Article page with breadcrumbs and navigation

๐ŸŽฏ Logo Configuration

Vue Docs UI supports multiple logo formats:

site:
  # Emoji (simplest)
  logo: "๐Ÿค–"
  
  # Local image
  logo: "/images/logo.png"
  
  # Online image
  logo: "https://example.com/logo.svg"
  
  # Relative path
  logo: "./assets/logo.svg"

Logo Requirements:

  • Recommended formats: PNG, SVG (vector graphics preferred)
  • Recommended size: 32-64px height, auto width
  • File size: < 100KB recommended
  • Supported formats: PNG, SVG, JPG, GIF, WebP, ICO

๐ŸŽจ Multi-Theme System (NEW!)

Vue Docs UI now supports 6 beautiful preset themes with complete configuration control:

Available Themes

Theme Description Best for
default Modern blue theme General documentation
vue Vue.js official green theme Vue projects
github GitHub-style monochrome Open source projects
purple Elegant purple theme Design systems
orange Warm orange theme Marketing sites
emerald Fresh green theme Eco-friendly projects

Basic Theme Configuration

theme:
  # Select theme: default | vue | github | purple | orange | emerald
  theme: "vue"
  
  # Default mode: light | dark | auto
  defaultMode: "auto"
  
  # Allow users to toggle theme/mode
  allowToggle: true
  
  # Show theme switcher component
  showThemeSwitcher: true

Theme Mode Options

  • "light": Force light mode
  • "dark": Force dark mode
  • "auto": Auto-detect system preference (recommended)

Theme Control Options

  • allowToggle: true: Users can switch themes and modes
  • allowToggle: false: Lock theme configuration
  • showThemeSwitcher: true: Show theme picker in header
  • showThemeSwitcher: false: Hide theme picker

Configuration Priority

  1. User Selection (localStorage)
  2. Config File (site.yaml)
  3. System Preference (for auto mode)
  4. Default Values

Example Configurations

Fixed Theme Mode:

theme:
  theme: "github"
  defaultMode: "light"
  allowToggle: false
  showThemeSwitcher: false

Full User Control:

theme:
  theme: "default"
  defaultMode: "auto"
  allowToggle: true
  showThemeSwitcher: true

Brand Specific:

theme:
  theme: "vue"          # Vue theme for Vue projects
  defaultMode: "auto"
  allowToggle: true
  showThemeSwitcher: true

๐Ÿ”ง Advanced Usage

Custom Components

import createDocsApp from 'vue-docs-ui'
import 'vue-docs-ui/dist/style.css'
import MyCustomHome from './MyCustomHome.vue'
import MyCustomArticle from './MyCustomArticle.vue'

createDocsApp({
  configPath: '/config/site.yaml',
  el: '#app',
  customComponents: {
    home: MyCustomHome,
    article: MyCustomArticle
  }
})

Component Library Mode

import { createApp } from 'vue'
import { DocsLayout, loadConfig } from 'vue-docs-ui'
import 'vue-docs-ui/dist/style.css'

const config = await loadConfig('/config/site.yaml')
const app = createApp(DocsLayout, { config })
app.mount('#app')

Available Components

import {
  DocsLayout,
  HeaderNav,
  SidebarNav,
  TableOfContents,
  MarkdownRenderer,
  DefaultHome,
  DefaultArticle,
  createDocsApp,
  loadConfig
} from 'vue-docs-ui'

๐Ÿ“ฑ Responsive Design

Vue Docs UI is fully responsive:

  • Desktop: Full sidebar + content + table of contents
  • Tablet: Sidebar + content (TOC hidden)
  • Mobile: Overlay sidebar with smooth animations

๐Ÿ” Markdown Features

  • โœ… Standard Markdown syntax
  • โœ… Syntax highlighting for code blocks
  • โœ… Auto-generated table of contents
  • โœ… Responsive tables and images
  • โœ… Custom heading anchors
  • โœ… Math equations support (coming soon)

๐Ÿ“ Project Structure

my-docs-project/
โ”œโ”€โ”€ public/
โ”‚   โ”œโ”€โ”€ config/
โ”‚   โ”‚   โ””โ”€โ”€ site.yaml        # Site configuration
โ”‚   โ””โ”€โ”€ docs/               # Markdown content
โ”‚       โ”œโ”€โ”€ guide/
โ”‚       โ”‚   โ”œโ”€โ”€ quick-start.md
โ”‚       โ”‚   โ””โ”€โ”€ configuration.md
โ”‚       โ””โ”€โ”€ advanced/
โ”‚           โ””โ”€โ”€ customization.md
โ”œโ”€โ”€ src/
โ”‚   โ””โ”€โ”€ main.ts             # Just 3 lines of code
โ”œโ”€โ”€ index.html
โ”œโ”€โ”€ package.json
โ””โ”€โ”€ vite.config.js

๐Ÿšฆ Migration from Other Tools

From VitePress

# VitePress config.js equivalent in YAML
site:
  title: "My Docs"
  description: "Documentation site"

navbar:
  items:
    - title: "Guide"
      link: "/guide/"

sidebar:
  sections:
    - title: "Getting Started"
      children:
        - title: "Introduction"
          path: "/guide/introduction"

From Docusaurus

Vue Docs UI provides a simpler, Vue-focused alternative with zero configuration complexity.

๐ŸŽฏ Comparison

Feature Vue Docs UI VitePress Docusaurus
Setup Complexity โญ 3 lines โญโญ Config needed โญโญโญ Complex setup
Vue 3 Support โœ… Native โœ… Yes โŒ React only
Zero Config โœ… Out of box โญโญ Needs config โญโญ Needs config
TypeScript โœ… Full support โœ… Yes โœ… Yes
Customization โญโญโญ Highly flexible โญโญ Medium โญโญโญ Highly flexible
Performance โญโญโญ Excellent โญโญโญ Excellent โญโญ Good

๐Ÿ› ๏ธ Development

Prerequisites

  • Node.js 16+
  • npm/yarn/pnpm

Development Setup

# Clone the repository
git clone https://github.com/vue-docs-ui/vue-docs-ui.git
cd vue-docs-ui

# Install dependencies
npm install

# Start development server
npm run dev

# Build library
npm run build:lib

# Run example
cd example && npm run dev

Build Commands

npm run build:lib     # Build library for production
npm run build         # Build example site
npm run type-check    # TypeScript type checking
npm run preview       # Preview built site

๐Ÿ“ฆ Publishing to NPM

This package is ready for NPM publication:

# Dry run (test without publishing)
npm run publish:dry

# Version bump
npm run version:patch  # 1.0.0 โ†’ 1.0.1
npm run version:minor  # 1.0.0 โ†’ 1.1.0
npm run version:major  # 1.0.0 โ†’ 2.0.0

# Publish to NPM
npm publish

The package includes:

  • โœ… TypeScript declarations
  • โœ… ES and UMD builds
  • โœ… CSS bundle
  • โœ… Proper exports configuration
  • โœ… Tree-shaking support

๐ŸŒ Browser Support

  • Chrome >= 87
  • Firefox >= 78
  • Safari >= 14
  • Edge >= 88

๐Ÿ“ License

MIT License - see LICENSE file for details.

๐Ÿค Contributing

We welcome contributions! Please see our Contributing Guide for details.

๐Ÿ“– Documentation in multiple languages:

Quick Contributing

Development Workflow

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

๐Ÿ“ž Support

๐Ÿ“Š Stats

npm downloads bundle size GitHub stars GitHub forks GitHub issues

๐Ÿ™ Acknowledgments

  • Built with Vue.js 3
  • Powered by Vite
  • Icons by Lucide
  • Inspired by modern documentation tools

Made with โค๏ธ by the Vue Docs UI Team

About

๐Ÿš€ Modern Vue 3 documentation framework - Create beautiful docs websites with YAML configuration and Markdown rendering. Zero setup, fully responsive, with dark/light themes.

Resources

License

Contributing

Stars

Watchers

Forks

Packages

No packages published