Components

About 2 min

By using vuepress-plugin-components, you can import and use some components in your Markdown files.

Available components:

  • Badge
  • CodePen
  • FontIcon
  • PDF
  • StackBlitz

By default, <Badge /> and <CodePen /> is enabled.

To enable components, you should set plugin.components with an array of components name.

Badge

A badge component.

  • tip
  • warning
  • danger
  • info
  • note

See Badgeopen in new window page for available props.

CodePen

A component which allows you to embed CodePen demo.

A demo with user and slug hash:

<CodePen
  user="kowlor"
  slug-hash="ZYYQoy"
  title="Solar System animation - Pure CSS"
  :default-tab="['css','result']"
  :theme="$isDarkMode? 'dark': 'light'"
/>

A demo with link:

<CodePen
  link="https://codepen.io/kowlor/pen/ZYYQoy"
  title="Solar System animation - Pure CSS"
  :default-tab="['css','result']"
  :theme="$isDarkMode? 'dark': 'light'"
/>

A click to run demo:

<CodePen
  link="https://codepen.io/kowlor/pen/ZYYQoy"
  title="Envelope w/ Hearts"
  status="clicktorun"
  :default-tab="['css','result']"
  :theme="$isDarkMode? 'dark': 'light'"
/>

See CodePenopen in new window page for available props.

FontIcon

Component which allows you to display font icons.

  • Home icon:
  • A big and red markdown icon:
- Home icon: <FontIcon icon="home" />
- A big and red markdown icon: <FontIcon icon="markdown" color="red" size="32" />

See FontIconopen in new window page for available props.

PDF

PDF viewer component.

Default PDF viewer:

<PDF url="/sample.pdf" />

PDF viewer without toolbar:

<PDF url="/sample.pdf" :toolbar="false" />

PDF viewer with initial page 2:

<PDF url="/sample.pdf" :page="2" />

See PDFopen in new window page for available props.

StackBlitz

Embed StackBlitz demo in markdown files.

<StackBlitz id="vuepress-theme-hope" />
<StackBlitz id="vuepress-theme-hope" hideExplorer hideNavigation hidedevtools />

See StackBlitzopen in new window page for available props.

YouTube

Embed YouTube video in markdown files.

<YouTube id="0JJPfz5dg20" />
<YouTube id="0JJPfz5dg20" disable-fullscreen />
<YouTube list-type="playlist" list="PLJNLwTPak6dhCRzVelZIs2-DfBp01NX_1" />

See YouTubeopen in new window page for available props.

Loading...