---
title: "useDocsNavigation"
description: "Reuse the docs navigation tree loaded by the site shell in your own navigation components."
canonical_url: "https://docs.mhaibaraai.me/en/docs/reference/composables/use-docs-navigation"
---
# useDocsNavigation

> Reuse the docs navigation tree loaded by the site shell in your own navigation components.

`useDocsNavigation()` returns the navigation tree that [`useDocsShell`](https://docs.mhaibaraai.me/en/docs/reference/composables/use-docs-shell) provides in `app.vue`, already loaded and transformed for the current locale.

## Usage

```vue [app/components/SectionList.vue]
<script setup lang="ts">
const navigation = useDocsNavigation()
</script>

<template>
  <ul>
    <li v-for="section in navigation" :key="section.path">
      <NuxtLink :to="section.path">
        {{ section.title }}
      </NuxtLink>
    </li>
  </ul>
</template>
```

## Signature

```ts
function useDocsNavigation(): Ref<ContentNavigationItem[] | undefined>
```

## Return Value

| Name | Type | Description |
| --- | --- | --- |
| (return value) | `Ref<ContentNavigationItem[] \| undefined>` | Top-level sections under the docs root; each `children` holds the section's pages, and the `category` and `description` frontmatter fields are kept on each node |

## Notes

- Call it inside the component tree of `app.vue` or `error.vue`. Outside the shell (for example a custom `app.vue` that does not call `useDocsShell`) you get a ref whose value is `undefined`.
- The injection key is the string `'navigation'`. v2 code that calls `inject('navigation')` directly still works; new code should use this function.
- To group by category or build breadcrumbs, pass the result to [`useNavigation`](https://docs.mhaibaraai.me/en/docs/reference/composables/use-navigation).

## Changelog

See commit history for [layer/app/composables/useDocsShell.ts](https://github.com/mhaibaraai/movk-nuxt-docs/commits/main/layer/app/composables/useDocsShell.ts).

---

- [GitHub](https://github.com/mhaibaraai/movk-nuxt-docs/blob/main/layer/app/composables/useDocsShell.ts)


## Sitemap

See the full [sitemap](https://docs.mhaibaraai.me/sitemap.md) for all pages.
