CodeGroup
Group multiple code examples in tabbed interfaces for easy comparison.
Usage
Wrap your code blocks around a code-group component to group them together in tabs.
pnpm add pohon-ui
npm install pohon-ui
bun add pohon-ui
::code-group
```bash [pnpm]
pnpm add pohon-ui
```
```bash [npm]
npm install pohon-ui
```
```bash [bun]
bun add pohon-ui
```
::
API
Props
| Prop | Default | Type |
|---|---|---|
defaultValue | '0' | stringThe default tab to select. |
sync | stringSync the selected tab with a local storage key. | |
modelValue | string | |
pohon | { root?: ClassValue; list?: ClassValue; indicator?: ClassValue; trigger?: ClassValue; triggerIcon?: ClassValue; triggerLabel?: ClassValue; } |
Slots
| Slot | Type |
|---|---|
default | object |
Theme
We use unocss-variants to customize the theme. Read more about it in the theming guide.
Below is the theme configuration skeleton for the ProseCodeGroup. Since the component is provided unstyled by default, you will need to fill in these values to apply your own custom look and feel. If you prefer to use our pre-built, opinionated styling, you can instead use our UnoCSS preset, this docs is using it as well.
app.config.ts
export default defineAppConfig({
pohon: {
prose: {
codeGroup: {
slots: {
root: '',
list: '',
indicator: '',
trigger: '',
triggerIcon: '',
triggerLabel: ''
}
}
}
}
};
vite.config.ts
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import pohon from 'pohon-ui/vite'
export default defineAppConfig({
pohon: {
prose: {
codeGroup: {
slots: {
root: '',
list: '',
indicator: '',
trigger: '',
triggerIcon: '',
triggerLabel: ''
}
}
}
}
};
Changelog
No recent changes