Vue CLI Plugin for Styleguidist

4.72.4 · active · verified Sun Apr 19

The `vue-cli-plugin-styleguidist` package integrates Vue Styleguidist into projects initialized with Vue CLI 3.0 or higher. It streamlines the setup process, allowing developers to generate live-reloading component documentation and a style guide directly within their Vue CLI workflow. The current stable version is `4.72.4`, with a release cadence that includes regular patch updates addressing compatibility issues and feature enhancements, primarily through its underlying `vue-styleguidist` and `vue-docgen-api` dependencies. Key differentiators include its tight integration with the Vue CLI ecosystem, simplifying initial configuration and command-line execution for component documentation compared to a manual setup of Vue Styleguidist.

Common errors

Warnings

Install

Imports

Quickstart

Demonstrates how to install the plugin, add it to a Vue CLI project, and run the style guide command to generate documentation.

vue create my-project
cd my-project
vue add styleguidist

# The plugin will prompt you for configuration details.
# After installation, generate the styleguide:
yarn styleguide

# This will typically open the style guide in your browser.
# To customize, edit the generated `styleguide.config.js` or `styleguide.config.ts`.
// Example of a basic component in src/components/MyComponent.vue
// <template>
//   <button :class="{ primary }" @click="$emit('click')">{{ label }}</button>
// </template>
// <script setup lang="ts">
// import { defineProps, defineEmits } from 'vue';
//
// interface Props {
//   label: string;
//   primary?: boolean;
// }
//
// const props = defineProps<Props>();
// const emit = defineEmits<{ (e: 'click'): void }>();
// </script>
// <style scoped>
// .primary { background-color: blue; color: white; }
// </style>

view raw JSON →