Code Tabs
Less than 1 minute
The theme provides you code tabs support.
Settings
import { hopeTheme } from "vuepress-theme-hope";
export default hopeTheme({
markdown: {
codeTabs: true,
},
});Usage
This is the same as tabs feature, but it's special built for code blocks.
Only the first code fence after @tab marker is rendered inside code tabs, other Markdown content will be ignored.
Demo
Install VuePress:
pnpm
pnpm add -D vuepressyarn
yarn add -D vuepressnpm
npm i -D vuepressInstall VuePress Theme Hope:
pnpm
pnpm add -D vuepress-theme-hopeyarn
yarn add -D vuepress-theme-hopenpm
npm i -D vuepress-theme-hopeDemo
Install VuePress:
::: code-tabs#shell
@tab pnpm
```bash
pnpm add -D vuepress
```
@tab yarn
```bash
yarn add -D vuepress
```
@tab:active npm
```bash
npm i -D vuepress
```
:::
Install VuePress Theme Hope:
::: code-tabs#shell
@tab pnpm
```bash
pnpm add -D vuepress-theme-hope
```
@tab yarn
```bash
yarn add -D vuepress-theme-hope
```
@tab:active npm
```bash
npm i -D vuepress-theme-hope
```
:::Changelog
6/4/25, 1:34 PM
View All Changelog
1bd5f-on55e92-onb1230-on22787-on99f51-onb41c0-on