For vue2 projects, use @94ai/common-ui

Writing docs ​

Documentation supports Markdown, Vue components and live examples. Use the top search box to find pages and headings.

Demo blocks ​

Both demo and editable containers support inline editing. Four icons open the playground, switch JS/TS, copy code, and expand/collapse the editor. Code is collapsed initially. Expand it to edit and update the preview after approximately 250ms without leaving the page. Collapsing keeps your current draft.

Copying and opening the playground use the current code, component theme and documentation language. JS/TS switching converts the source and retains separate in-memory drafts. Converting to JS removes types; switching back restores the TS draft. Typed Vue macros are converted to equivalent JS with runtime props/emits preserved, rather than simply changing lang.

md
::: demo Theme configuration
```vue
<template>
  <NfConfigProvider theme="chalk" locale="en-US">
    <el-button type="primary">Button</el-button>
  </NfConfigProvider>
</template>
```
:::

Code blocks may include complete <script setup lang="ts">, <template> and <style scoped lang="scss"> sections. All DemoBlocks compile and run in the documentation as they approach the viewport, sharing its Vue, Element Plus and CommonUI runtime. No preview iframe or frontmatter opt-in is required. Errors appear in the example and recover when corrected. Drafts remain in page memory and reset on refresh; copy the source or use a playground share link to save them.

Document previews retain editing, JS/TS conversion, copy, expand/collapse, playground links, async setup/Suspense and CSS/SCSS/Sass. Dropdowns and service overlays use the full document viewport. Styles, locale and configuration-demo themes belong to each DemoBlock; recompilation and navigation clean up its resources without changing navigation or other examples. Only trusted repository examples and local edits run here: this is not a security sandbox, and URL/share code is never accepted. The standalone playground and share links remain iframe-isolated; use the playground for remote dependencies, JSX/TSX or CSS Modules.

Loading example…
SFC, TypeScript and SCSS

Notice containers ​

Supported containers: tip, warning, danger and info.

Tip

Examples use Vue 3 and Element Plus.

Warning

Examples use Vue 3 and Element Plus.

Danger

Examples use Vue 3 and Element Plus.

Info

Examples use Vue 3 and Element Plus.

Escaping code fences ``` ​

To display backticks inside inline code or a code block, use a longer backtick delimiter around the content so the inner backticks do not close it.

Backticks in inline code ​

Wrap content containing a single backtick with two backticks. For example, write:

md
``This code contains a ` character``

Rendered result: This code contains a ` character.

When the content consists only of backticks, add a space between the content and each delimiter. Wrap one backtick with two, or three backticks with four:

md
`` ` ``
```` ``` ````

Rendered results: ` and ```.

Displaying nested code fences ​

To show a triple-backtick code block in docs, wrap it with four backticks and the md language tag. The complete syntax below includes the outer four-backtick fence; retain it when copying:

md
````md
```vue
<NfButton type="primary">Button</NfButton>
```
````

Use more backticks for the outer fence than the inner one, and close it with the same number. To display a four-backtick fence, use five outside, and so on. Fenced content is displayed literally; it does not run Vue components or demo/editable containers.

Frontmatter support ​

Place YAML metadata between two --- lines at the very top of a Markdown file. Use title for the page title, description for its description, or add custom fields. Access custom fields in the page body through $frontmatter.

md
---
title: Example page
description: A frontmatter example
name: My Cool App
---

This is {{ $frontmatter.name }}

The example's body renders as:

html
<p>This is My Cool App</p>

This page also sets name: My Cool App. Its actual rendered result is:

This is My Cool App

In a Vue component or a Markdown <script setup> block, read the current page's frontmatter through VitePress's useData(). Access the ref with .value in script:

ts
import { useData } from 'vitepress'

const { frontmatter } = useData()
console.log(frontmatter.value.name)

Playground ​

Open the playground to edit SFCs, change themes/language and share your code.