Skip to main content
Docus is built on Nuxt, which means you can leverage Nuxt’s powerful extensibility features to customize every aspect of your documentation site.

Overriding Components

Replace any built-in Docus component by creating a file with the same name in your components/ directory.

Component Structure

Docus includes several key components you can override:

Example: Custom Header

Create a custom header by overriding AppHeader.vue:
[components/app/AppHeader.vue]
1

Create Component

Create a new component in components/app/AppHeader.vue
2

Copy Base Structure

Copy the base structure from the original component or create your own
3

Customize

Add your custom functionality, styling, or layout
4

Auto-Import

Nuxt automatically imports your component, overriding the default

Custom Layouts

Create custom layouts for different page types:
[layouts/custom.vue]
Use the layout in a page:
[content/docs/special-page.md]
Layouts give you full control over page structure while reusing components like AppHeader and AppFooter.

Custom Pages

Add custom pages by creating Vue components in the pages/ directory:
[pages/changelog.vue]

Extending Templates

Docus provides template pages that you can extend:

Landing Page Template

The default landing page template is used when you don’t have an index.vue:
[pages/index.vue]

Composables

Docus provides several composables you can use in your custom components:

useDocusI18n

Ref<boolean>
Whether i18n is enabled
Ref<string>
Current locale code
LocaleObject[]
Available locales
(key: string) => string
Translation function
(path: string) => string
Get localized path

useSeo

useLogoAssets

Custom Modules

Create Nuxt modules to add functionality to Docus:
[modules/analytics.ts]
Register the module:
[nuxt.config.ts]
When creating custom modules, ensure they don’t conflict with Docus’s internal modules: config, routing, markdown-rewrite, and css.

Plugins

Add functionality with Nuxt plugins:
[plugins/analytics.client.ts]
Use .client.ts suffix for plugins that only run in the browser:

API Routes

Add custom API endpoints:
[server/api/search.ts]
1

Create Handler

Create a file in server/api/ directory
2

Define Logic

Implement your API logic using Nuxt Content or other data sources
3

Use in Frontend

Call the API from your components:

Middleware

Add route middleware for authentication or redirects:
[middleware/auth.ts]
Apply globally or per-page:
[pages/admin.vue]

Nitro Configuration

Customize the server with Nitro configuration:
[nuxt.config.ts]
Automatically discover and prerender linked pages
object
Configure caching, headers, and redirects per route pattern

Content Hooks

Hook into content processing:
[nuxt.config.ts]

Next Steps

Nuxt Documentation

Learn more about Nuxt features

Nuxt Content

Explore Content module capabilities