Custom container
About 1 min
The theme adds tip, note, info, warning, danger and detail container.
Config
// .vuepress/config.ts
import { defineUserConfig } from "vuepress";
import { hopeTheme } from "vuepress-theme-hope";
export default defineUserConfig({
theme: hopeTheme({
plugins: {
mdEnhance: {
// this is the default option, so you can use it directly
container: true,
},
},
}),
});
// .vuepress/config.js
import { hopeTheme } from "vuepress-theme-hope";
export default {
theme: hopeTheme({
plugins: {
mdEnhance: {
// this is the default option, so you can use it directly
container: true,
},
},
}),
};
Demo
Info
Information container
Note
Note container
Tips
Tip container
Note
Warning container
Warning
Dangerous container
Details
Details container
Custom info
Custom note
Custom tip
Custom warning
Custom danger
::: info
Information container
:::
::: note
Note container
:::
::: tip
Tip container
:::
::: warning
Warning container
:::
::: danger
Dangerous container
:::
::: details
Details container
:::
::: info Custom Title
A custom information container with `code`, [link](#demo).
```js
const a = 1;
```
:::
::: note Custom Title
A custom note container with `code`, [link](#demo).
```js
const a = 1;
```
:::
::: tip Custom Title
A custom tip container with `code`, [link](#demo).
```js
const a = 1;
```
:::
::: warning Custom Title
A custom warning container with `code`, [link](#demo).
```js
const a = 1;
```
:::
::: danger Custom Title
A custom danger container with `code`, [link](#demo).
```js
const a = 1;
```
:::
::: details Custom Title
A custom details container with `code`, [link](#demo).
```js
const a = 1;
```
:::
::: info Custom info
:::
::: note Custom note
:::
::: tip Custom tip
:::
::: warning Custom warning
:::
::: danger Custom danger
:::