VuePress EcosystemVuePress Ecosystem
  • Theme Guidelines
  • theme-default
  • Hope Theme
  • Plume Theme
  • Reco Theme
  • Feature Plugins
  • Markdown Plugins
  • Search Plugins
  • Blog Plugins
  • PWA Plugins
  • Analytics Plugins
  • SEO Plugins
  • Development Plugins
  • Tool Plugins
  • AI Plugins
  • @vuepress/helper
  • English
  • 简体中文
GitHub
  • Theme Guidelines
  • theme-default
  • Hope Theme
  • Plume Theme
  • Reco Theme
  • Feature Plugins
  • Markdown Plugins
  • Search Plugins
  • Blog Plugins
  • PWA Plugins
  • Analytics Plugins
  • SEO Plugins
  • Development Plugins
  • Tool Plugins
  • AI Plugins
  • @vuepress/helper
  • English
  • 简体中文
GitHub
  • append-date
  • markdown-chart
    • markdown-chart
    • Chart.js
    • ECharts
    • Flowchart
    • Markmap
    • Mermaid
    • PlantUML
  • markdown-container
  • markdown-ext
  • markdown-field
  • markdown-file-tree
  • markdown-image
  • markdown-include
  • markdown-hint
  • markdown-math
  • markdown-preview
  • markdown-stylize
  • markdown-tab
  • links-check
  • prismjs
  • revealjs
    • revealjs
    • Slide Demo
    • Reveal.js Themes
  • shiki

markdown-field

@vuepress/plugin-markdown-field

Add fields to your VuePress site.

Usage

npm i -D @vuepress/plugin-markdown-field@next
.vuepress/config.ts
import { markdownFieldPlugin } from '@vuepress/plugin-markdown-field'

export default {
  plugins: [
    markdownFieldPlugin({
      // Enable fields
      fields: true,
    }),
  ],
}

Syntax

You can use ::: fields container to describe field information, including field name, type, whether it's required, default value, etc.

Inside the container, lines starting with @name@ are field items. Attributes are appended after the closing @.

::: fields
@theme@ type="ThemeConfig" required default="{ base: '/' }"

Theme Config

@enabled@ type="boolean" optional default="true"

Whether it's enabled

:::

By default, all attributes are allowed and displayed as-is. Common attributes include type, required, optional, default and deprecated.

  • type is displayed as a code block in the field header.
  • default is displayed as a labeled code block below the field header.
  • required, optional and deprecated are displayed as badges, and a deprecated field's name is colored red and struck through.
  • Other attributes are displayed as Name: value badges.

Nesting

Fields can be nested to describe fields of an object type. To create a field item inside another field, increase the starting @ by one for each level of nesting.

::: fields
@options@ type="object"

Options.

@@options.name@ type="string"

Option name.

@other@ type="string"

Other field.

:::

For more syntax details, see @mdit/plugin-field.

Demo

themeRequiredThemeConfig
Default{ base: '/' }

Theme Config

enabledOptionalboolean
Defaulttrue

Whether it's enabled

otherDeprecatedstring

Deprecated field

Options

fields

  • Type: boolean
  • Details: Whether to enable fields.

locales

  • Type: MarkdownFieldPluginLocaleConfig
interface MarkdownFieldPluginLocaleData {
  /**
   * Label text for the `default` attribute
   */
  default: string

  /**
   * Badge text for the `required` attribute
   */
  required: string

  /**
   * Badge text for the `optional` attribute
   */
  optional: string

  /**
   * Badge text for the `deprecated` attribute
   */
  deprecated: string
}
  • Details: Locale config for badge texts.
Edit this page on GitHub
Last Updated: 9/8/26, 1:07 PM
Contributors: Mister-Hope
Prev
markdown-ext
Next
markdown-file-tree