---
title: "useCategory"
description: "useCategory manages the category configuration system for the documentation sidebar, defining each category's display title and ordering rules via the categories property to group component or composable documentation by feature. Override the implementation at app/composables/useCategory.ts to customize the category configuration."
canonical_url: "https://docs.mhaibaraai.cn/en/docs/composables/use-category"
---
# useCategory

> useCategory manages the category configuration system for the documentation sidebar, defining each category's display title and ordering rules via the categories property to group component or composable documentation by feature. Override the implementation at app/composables/useCategory.ts to customize the category configuration.

## Overview

Manages the documentation category system, making it easy to group and navigate documentation.

### Configuring categories

Create `composables/useCategory.ts` in your project to override the default configuration:

```ts
export function useCategory() {
  return {
    categories: {
      components: [
        {
          id: 'content',
          title: 'Content Components',
          icon: 'i-lucide-component'
        },
        {
          id: 'layout',
          title: 'Layout Components',
          icon: 'i-lucide-layout-dashboard'
        }
      ],
      composables: [
        {
          id: 'navigation',
          title: 'Navigation',
          icon: 'i-lucide-compass'
        },
        {
          id: 'ui',
          title: 'UI Utilities',
          icon: 'i-lucide-sparkles'
        }
      ]
    }
  }
}
```

### Using categories in frontmatter

```md
---
title: ComponentPropsLinks
category: content
---
```

## API

### `useCategory()`

Returns the category configuration.

### Return value

**categories** (`Record<string, Category[]>`): The category configuration object, keyed by documentation directory slug.The category ID, corresponding to the category field in the frontmatter.The category display title.The category icon class name.

## Changelog

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

---

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


## Sitemap

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