Skip to content

Components in Slides ​

One of the most powerful features of Slidev is the ability to use Vue components directly in your slides. This allows you to create interactive and dynamic content with ease.

Using Components ​

With the help of unplugin-vue-components, Slidev allows you to use Vue components directly in your slides without importing them manually:

md
# My Slide

<MyComponent :count="4"/>

The components come from:

  • Built-in components. See Built-in Components for reference.
  • Provided by the theme and addons. See 📖 Theme & Addons.
  • Custom components in the components directory. See the next section.

Writing Components ​

To create a custom component, simply create a new Vue file in the components directory:

bash
your-slidev/
  ├── ...
  ├── slides.md
  └── components/
      ├── ...
      └── MyComponent.vue

Refer to the Vue documentation for how to write Vue components.

You can also 📖 Writing Addons to reuse and share your components with others.

Released under the MIT License.