Skip to content

Component overrides

Replace one Docs component or add a small extension without copying a layout.

On this page

Component families

DirectoryPurposeExamples
components/ui/IPEX interface primitives, prefixed with UiUiButton, UiTabs
components/docs/Documentation shellDocsLayout, DocsHeader, DocsSidebar, DocsPage
components/content/Globally available Markdown componentsTabs, Steps, CodeTabs
components/prose/Standard Markdown renderersProseH2, 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.

app/components/docs/DocsFooter.vue
<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.

ComponentLocationProps
DocsHeaderActionsRight of the docs headersettings
DocsSidebarTopAbove sidebar navigation; contains the space switcher by defaultsettings
DocsSidebarBottomBefore the sidebar's home linksettings
DocsPageBeforeBefore the page headerpage, space, settings
DocsPageAfterAfter rendered Markdownpage, space, settings
DocsTocBottomBelow the desktop TOCpage, 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().

app/components/docs/DocsPageAfter.vue
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

ComponentPropsSlots / behavior
DocsLayoutNoneDefault page content, header, sidebar; provides layout dimensions and search
DocsHeadersettings, currentCategory, currentTitleactions; emits navigation and search
DocsSidebartree, settings; v-model:collapsedtop, bottom; exposes toggle()
DocsPagepageDefault rendered content, before, header, after, toc
DocsPageHeaderpage, settingsTitle, description, copy link, edit link
DocsPageNavigationOptional previous, next navigation itemsSpace-scoped adjacent links
DocsFootersettings, optional pageDefault footer content
DocsToclinksExisting heading tracking and accent indicator
DocsSearchv-model:openLocale-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.

Indocio · Built with Nuxt Content, IPEX, and Akaza UI.