Component overrides
Replace one Docs component or add a small extension without copying a layout.
On this page
Component families
| Directory | Purpose | Examples |
|---|---|---|
components/ui/ | IPEX interface primitives, prefixed with Ui | UiButton, UiTabs |
components/docs/ | Documentation shell | DocsLayout, DocsHeader, DocsSidebar, DocsPage |
components/content/ | Globally available Markdown components | Tabs, Steps, CodeTabs |
components/prose/ | Standard Markdown renderers | ProseH2, ProseA, ProsePre |
Start with configuration. Use an extension component for extra content. Replace a shell component when its rendering needs to change.
Override from your app
Create an identically named component in your app. Nuxt gives the consuming app priority over the layer. Docs components resolve automatically rather than importing the layer's implementation directly.
<script setup lang="ts">
import type { DocsConfig } from '@igrislabs/indocio/types'
defineProps<{ settings: DocsConfig; page?: unknown }>()
</script>
<template>
<footer class="mt-12 border-t border-border pt-6 text-sm">
Your team's documentation. <a href="https://example.com/support">Get help</a>.
</footer>
</template>
Extension components
These components are deliberately small. Override one to add content in a supported location.
| Component | Location | Props |
|---|---|---|
DocsHeaderActions | Right of the docs header | settings |
DocsSidebarTop | Above sidebar navigation; contains the space switcher by default | settings |
DocsSidebarBottom | Before the sidebar's home link | settings |
DocsPageBefore | Before the page header | page, space, settings |
DocsPageAfter | After rendered Markdown | page, space, settings |
DocsTocBottom | Below the desktop TOC | page, space, settings |
Use await useDocsContext() inside any override to access the active locale's navigation, spaces, active space, sidebar tree, and ordered pages. useIndocio() provides branding, locale scope, home URL, and localPath().
export default defineNuxtConfig({
extends: ['@igrislabs/indocio'],
content: {
build: { markdown: { toc: { depth: 2, searchDepth: 4 } } },
},
})
When replacing DocsHeaderActions, include SiteNavigation, LocaleSwitch, ColorModeButton, and DocsCustomizerTrigger if you want those controls. When replacing DocsSidebarTop, include DocsSpaceSwitcher to keep the product selector.
The core DocsSidebarBottom includes a Customize this layout button when the live customizer is enabled. The documentation app keeps this trigger in its own override.
Shell component contracts
| Component | Props | Slots / behavior |
|---|---|---|
DocsLayout | None | Default page content, header, sidebar; provides layout dimensions and search |
DocsHeader | settings, currentCategory, currentTitle | actions; emits navigation and search |
DocsSidebar | tree, settings; v-model:collapsed | top, bottom; exposes toggle() |
DocsPage | page | Default rendered content, before, header, after, toc |
DocsPageHeader | page, settings | Title, description, copy link, edit link |
DocsPageNavigation | Optional previous, next navigation items | Space-scoped adjacent links |
DocsFooter | settings, optional page | Default footer content |
DocsToc | links | Existing heading tracking and accent indicator |
DocsSearch | v-model:open | Locale-aware search with optional all-space scope |
DocsPage's default slot receives page; its before and after slots receive page, space, and settings.
The default layouts/default.vue composes DocsLayout. You can replace the app layout to use its slots, while keeping the shell's existing behavior.
Styling
Keep accent and other branding overrides in your app's CSS. Core accent falls back to primary. Use documented layout variables instead of selectors that depend on private DOM nesting.