Built-in Components
Less than 1 minute
By using vuepress-plugin-components, you can import and use some components in your Markdown files.
Available components:
- Badge: Colorful badge component
- CodePen: Embedded CodePen demo
- Share: Sharing current page with social medias
- StackBlitz: Embedded StackBlitz demo
- SiteInfo: Display sites
- VPBanner: A banner component
- VPCard: A card component
To enable components, you should set plugins.components.components with an array of components names.
Tips
Media components are provided by @vuepress/plugin-media, which are enabled via plugins.media.
Note
By default, <Badge /> is available to align with @vuepress/theme-default.
import { hopeTheme } from "vuepress-theme-hope";
export default hopeTheme({
plugins: {
components: {
// components you want
components: [
"Badge",
"CodePen",
"Share",
"SiteInfo",
"StackBlitz",
"VPBanner",
"VPCard",
],
},
},
});Utilities
Badge
- tip
- warning
- danger
- important
- info
- note
Badge types
- <Badge text="tip" type="tip" vertical="middle" />
- <Badge text="warning" type="warning" vertical="middle" />
- <Badge text="danger" type="danger" vertical="middle" />
- <Badge text="important" type="important" vertical="middle" />
- <Badge text="info" type="info" vertical="middle" />
- <Badge text="note" type="note" vertical="middle" />See Badge page for available props.
SiteInfo
Basic site info
<SiteInfo name="Mr.Hope's Blog" url="https://mister-hope.com" preview="https://theme-hope.vuejs.press/assets/image/mrhope.jpg" />Site info with more properties
<SiteInfo
name="Mr.Hope's Blog"
desc="Where there is light, there is hope"
url="https://mister-hope.com"
logo="https://mister-hope.com/logo.svg"
repo="https://github.com/Mister-Hope/Mister-Hope.github.io"
preview="https://theme-hope.vuejs.press/assets/image/mrhope.jpg"
/>See SiteInfo page for available props.
Share
Basic share
<Share />Customize services
<Share services="qq,weibo" />
<Share :services="['qq','weibo']" />Colorful icon
<Share colorful />See Share page for available props.
Code
CodePen
A component which allows you to embed CodePen demo.
See Solar System animation - Pure CSS by kowlor on CodePen.
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'"
/>See Solar System animation - Pure CSS by kowlor on CodePen.
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'"
/>See Envelope w/ Hearts by kowlor on CodePen.
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 CodePen page for available props.
StackBlitz
Embed StackBlitz demo in Markdown files.
A StackBlitz project
<StackBlitz id="vuepress-theme-hope" />A StackBlitz project with custom settings
<StackBlitz id="vuepress-theme-hope" hideExplorer hideNavigation hideDevtools />See StackBlitz page for available props.
Changelog
9/28/26, 12:45 PM
View All Changelog
0c1aa-on4ea6d-on1bd5f-on68504-on5a8ce-on55e92-onac7cf-onb1230-on66d77-ondd4a8-on99f51-on16ba7-on96c95-onfeeb4-onb41c0-on2f66e-on54c46-on497db-on5c0cb-on9b413-on1da28-on3f311-on0739c-on0f844-on757fd-on43072-one728e-on02c41-ond09ab-on5a136-on34452-ond3b16-ond82a8-on7e98c-onc887b-on6136a-on8f6b0-on2a306-one9ea0-one08cc-on9b72f-on760c6-on737eb-on8174c-on9100f-onf5b66-on3cdac-on5412c-on93657-onc8d60-onb65b9-on90058-ond69e5-onae2d2-onab41c-on69cce-on6b8c4-onc0c7e-on58b12-one835b-on1e7ba-onb8835-onc7061-on88255-on145a8-on2243a-on84771-on0b6f3-one2bb6-on3dac6-on2fa50-on22c53-on3c8d6-on57c57-onf732e-on55cc9-on9856d-onaab9e-onc540c-one0f17-on6c51a-on48bca-on008a9-ond031d-on07909-on306d2-onf635d-on88e69-ondb823-on1eb77-oned3ab-on2d1be-onf6ff0-on3c199-on