Skip to content

Markmap Examples

Code Block Form

Basic Usage

Use markmap code blocks to insert Markdown file content:

Custom Configuration Examples

Basic Configuration

Advanced Configuration

Dark Mode Adaptation

Component Form

Basic Usage

Use component form to specify Markdown file path and read Markdown file content:

showToolbar is an optional parameter. By default, the toolbar is not shown. Add the showToolbar parameter to display the toolbar.

vue
<!-- Specify path to read specified file (supports relative and absolute paths) -->
<PreviewMarkmapPath path="./Vue.md" />
vue
<!-- No path specified, reads current file -->
<PreviewMarkmapPath showToolbar />

Component Usage with Configuration

You can also add configuration in the referenced Markdown file:

markdown
## <!-- Add configuration in the referenced file -->

showToolbar: true
markmap:
color: ["#e74c3c", "#3498db", "#2ecc71", "#f1c40f", "#9b59b6"]
initialExpandLevel: 2
maxWidth: 450
duration: 350

---

# Component Test

## Frontend Frameworks

### React

#### Hooks

#### Context

### Vue

#### Composition API

#### Options API

## Build Tools

### Webpack

### Vite

### Rollup

## Databases

### SQL

#### PostgreSQL

#### MySQL

### NoSQL

#### MongoDB

#### Redis

Configuration Options Details

Basic Options

OptionTypeDefaultDescription
showToolbarbooleantrueWhether to show the toolbar
colorstring[]d3.schemeCategory10Array of node colors
initialExpandLevelnumber-1Initial expansion level, -1 means expand all levels
maxWidthnumber0Maximum width of nodes, 0 means no limit
durationnumber500Animation duration (milliseconds)

Layout Options

OptionTypeDefaultDescription
spacingHorizontalnumber80Horizontal spacing
spacingVerticalnumber5Vertical spacing
paddingXnumber2X-axis padding

Interaction Options

OptionTypeDefaultDescription
zoombooleantrueWhether to allow zooming
panbooleantrueWhether to allow panning
autoFitbooleanfalseWhether to automatically fit the container
fitRationumber1Fit ratio

Advanced Options

OptionTypeDefaultDescription
colorFreezeLevelnumber0Color freeze level
toggleRecursivelybooleanfalseWhether to toggle recursively
scrollForPanbooleanfalseWhether to scroll for panning
maxInitialScalenumber1Maximum initial scale
lineWidthnumber1Width of lines between nodes

Usage Tips

  1. Color Configuration: Color arrays will cycle if the number of nodes exceeds the number of colors
  2. Expansion Levels: initialExpandLevel: -1 means expand all levels, 0 means only expand the root node
  3. Performance Optimization: Too many nodes or complex configurations may affect rendering performance
  4. Responsive Design: Mind maps automatically adapt to container size
  5. Theme Adaptation: Supports VitePress light/dark theme switching

For more configuration options, please refer to the Markmap Official Documentation.