Code tabs
Group related code examples with accessible tabs, syntax highlighting, and a copy button for each example.
On this page
Multiple files
Wrap fenced code blocks in ::code-tabs. Filenames become tab labels. Each tab keeps its own code and copy button.
export default defineNuxtConfig({
extends: ['@igrislabs/indocio'],
})
Markdown syntax
::code-tabs{label="Layer configuration files"}
```ts [nuxt.config.ts]
export default defineNuxtConfig({
extends: ['@igrislabs/indocio'],
})
```
```ts [app.config.ts]
export default defineAppConfig({
indocio: { name: 'My documentation' },
})
```
::
Language labels
Omit filenames to use language names as labels. Set label to describe the group for screen readers. Keep fenced blocks as direct children of the component.
const project: string = 'Indocio'
Keyboard navigation
Focus a tab and use the left or right arrow keys to switch examples. Only the active code panel is exposed to assistive technology. Tab to its copy button to copy the original code, without formatting markup.
Package commands
Standalone install-command fences already provide package-manager tabs. Use code tabs for related files or alternate implementations.
pnpm add @igrislabs/indocioSee Package Commands for installation commands and Tabs for mixed Markdown panels.