---
title: "NavigationMenu"
description: "Список ссылок с горизонтальной или вертикальной ориентацией."
canonical_url: "https://b24-ui.bx-shef.by/docs/components/navigation-menu"
---
# NavigationMenu

> Список ссылок с горизонтальной или вертикальной ориентацией.

## Использование

Компонент NavigationMenu показывает список ссылок по горизонтали или по вертикали.

```vue
<script setup lang="ts">
import type { NavigationMenuItem } from '@bxshefby/b24ui-nuxt'

const items = ref<NavigationMenuItem[]>([
  {
    label: 'Управление продажами',
    type: 'trigger',
    children: [
      {
        label: 'Управление лидами'
      },
      {
        label: 'Управление сделками'
      },
      {
        label: 'Воронки'
      },
      {
        label: 'Права доступа'
      }
    ]
  },
  {
    label: 'Совместная работа',
    type: 'trigger',
    children: [
      {
        label: 'Онлайн-офис',
        to: 'https://www.bitrix24.com/tools/communications/online-workspace.php'
      },
      {
        label: 'CoPilot в чате',
        to: 'https://www.bitrix24.com/tools/copilot-ai-powered-tools-for-business.php#copilot-in-chat'
      },
      {
        label: 'useToast',
        to: '/docs/composables/use-toast'
      }
    ]
  },
  {
    label: 'HR и автоматизация',
    type: 'trigger',
    badge: 5,
    active: true,
    children: [
      {
        label: 'Управление сотрудниками',
        to: 'https://www.bitrix24.com/tools/hr_automation/employee-management.php'
      },
      {
        label: 'Культура и вовлечённость',
        to: 'https://www.bitrix24.com/tools/hr_automation/culture-and-engagement.php'
      },
      {
        label: 'Автоматизация',
        to: 'https://www.bitrix24.com/tools/hr_automation/automation.php',
        target: '_blank'
      }
    ]
  },
  {
    label: 'GitHub',
    to: 'https://github.com/bitrix24/b24ui',
    target: '_blank'
  },
  {
    label: 'Справка',
    disabled: true
  }
])
</script>

<template>
  <B24NavigationMenu :items="items" />
</template>
```

### Элементы

Пропс `items` — массив объектов со свойствами:

- `label?: string`
- `icon?: IconComponent`
- `avatar?: AvatarProps`
- `badge?: string | number | BadgeProps`
- [`chip?: boolean | ChipProps`](#with-chip-in-items)
- `hint?: string`
- [`tooltip?: TooltipProps`](#with-tooltip-in-items)
- [`popover?: PopoverProps`](#with-popover-in-items)
- `trailingIcon?: IconComponent`
- `type?: 'label' | 'trigger' | 'link'`
- `defaultOpen?: boolean`
- `open?: boolean`
- `value?: string`
- `disabled?: boolean`
- [`slot?: string`](#with-custom-slot)
- [`viewportRtl?: boolean`](#orientation)
- `onSelect?: (e: Event) => void`
- `children?: NavigationMenuChildItem[]`
- `class?: any`
- `b24ui?: { linkLeadingAvatarSize?: ClassNameValue, linkLeadingAvatar?: ClassNameValue, linkLeadingIcon?: ClassNameValue, linkLeadingChipSize?: ClassNameValue, linkLabel?: ClassNameValue, linkLabelExternalIcon?: ClassNameValue, linkTrailing?: ClassNameValue, linkLeadingHint?: ClassNameValue, linkLeadingBadgeSize?: ClassNameValue, linkLeadingBadge?: ClassNameValue, linkTrailingIcon?: ClassNameValue, label?: ClassNameValue, link?: ClassNameValue, content?: ClassNameValue, childList?: ClassNameValue, childLabel?: ClassNameValue, childItem?: ClassNameValue, childLink?: ClassNameValue, childLinkIcon?: ClassNameValue, childLinkHint?: ClassNameValue, childLinkBadgeSize?: ClassNameValue, childLinkBadge?: ClassNameValue, childLinkWrapper?: ClassNameValue, childLinkLabel?: ClassNameValue, childLinkLabelExternalIcon?: ClassNameValue, popoverWrapper?: ClassNameValue }`

Можно передать любое свойство компонента [Link](https://b24-ui.bx-shef.by/raw/docs/components/link.md#props), например `to`, `target` и другие.

```vue
<script setup lang="ts">
import type { NavigationMenuItem } from '@bxshefby/b24ui-nuxt'

const items = ref<NavigationMenuItem[]>([
  {
    label: 'Управление продажами',
    type: 'trigger',
    hint: 'note',
    children: [
      {
        label: 'Управление лидами'
      },
      {
        label: 'Управление сделками'
      },
      {
        label: 'Воронки',
        hint: 'note'
      },
      {
        label: 'Права доступа'
      }
    ]
  },
  {
    label: 'Совместная работа',
    type: 'trigger',
    children: [
      {
        label: 'Онлайн-офис',
        to: 'https://www.bitrix24.com/tools/communications/online-workspace.php'
      },
      {
        label: 'CoPilot в чате',
        to: 'https://www.bitrix24.com/tools/copilot-ai-powered-tools-for-business.php#copilot-in-chat'
      },
      {
        label: 'useToast',
        to: '/docs/composables/use-toast'
      }
    ]
  },
  {
    label: 'HR и автоматизация',
    type: 'trigger',
    badge: 5,
    active: true,
    children: [
      {
        label: 'Управление сотрудниками',
        to: 'https://www.bitrix24.com/tools/hr_automation/employee-management.php'
      },
      {
        label: 'Культура и вовлечённость',
        to: 'https://www.bitrix24.com/tools/hr_automation/culture-and-engagement.php'
      },
      {
        label: 'Автоматизация',
        to: 'https://www.bitrix24.com/tools/hr_automation/automation.php',
        target: '_blank'
      }
    ]
  },
  {
    label: 'GitHub',
    to: 'https://github.com/bitrix24/b24ui',
    target: '_blank'
  },
  {
    label: 'Справка',
    disabled: true
  }
])
</script>

<template>
  <B24NavigationMenu :items="items" class="w-full justify-center" />
</template>
```

> [!NOTE]
> В пропс `items` можно передать и массив массивов, чтобы показать группы элементов.

> [!TIP]
> Подменю задаются плоским массивом объектов `children`:
> - `label: string`
> - `icon?: IconComponent`
> - `onSelect?(e: Event): void`
> - `class?: any`
> Группировка заканчивается на верхнем уровне. В отличие от `items`, `children` принимает только **плоский** массив: вложенный массив разворачивается и отрисовывается без разделителя, а в режиме разработки в консоль пишется предупреждение.

### Ориентация

Пропс `orientation` меняет ориентацию NavigationMenu.

> [!NOTE]
> При вертикальной ориентации каждая группа отображается компонентом [Accordion](https://b24-ui.bx-shef.by/raw/docs/components/accordion.md). Состоянием открытия каждого элемента управляют свойства `open` и `defaultOpen`, а поведением — пропсы [`collapsible`](https://b24-ui.bx-shef.by/raw/docs/components/accordion.md#collapsible) и [`type`](https://b24-ui.bx-shef.by/raw/docs/components/accordion.md#multiple).

> [!NOTE]
> При вертикальной ориентации и несвёрнутом меню (`collapsed` не задан) дочерние элементы отрисовываются рекурсивно как обычные элементы, поэтому их стилизует `b24ui.link`. `b24ui.childLink` применяется только к `content` в `horizontal`-ориентации и к [popover](#with-popover-in-items) при `collapsed`.

> [!WARNING]
> У последнего элемента меню верхнего уровня нужно задать `viewportRtl`, чтобы выпадающее меню позиционировалось правильно.

```vue
<script setup lang="ts">
import type { NavigationMenuItem } from '@bxshefby/b24ui-nuxt'

const items = ref<NavigationMenuItem[][]>([
  [
    {
      label: 'Ссылки',
      type: 'label'
    },
    {
      label: 'Управление продажами',
      type: 'trigger',
      hint: 'note',
      defaultOpen: true,
      children: [
        {
          label: 'Управление лидами'
        },
        {
          label: 'Управление сделками'
        },
        {
          label: 'Воронки',
          hint: 'note'
        },
        {
          label: 'Права доступа'
        }
      ]
    }
  ],
  [
    {
      label: 'GitHub',
      to: 'https://github.com/bitrix24/b24ui',
      target: '_blank'
    },
    {
      label: 'Справка',
      disabled: true
    },
    {
      label: 'HR и автоматизация',
      type: 'trigger',
      viewportRtl: true,
      badge: 5,
      active: true,
      children: [
        {
          label: 'Управление сотрудниками',
          to: 'https://www.bitrix24.com/tools/hr_automation/employee-management.php'
        },
        {
          label: 'Культура и вовлечённость',
          to: 'https://www.bitrix24.com/tools/hr_automation/culture-and-engagement.php'
        },
        {
          label: 'Автоматизация',
          to: 'https://www.bitrix24.com/tools/hr_automation/automation.php',
          target: '_blank'
        }
      ]
    }
  ]
])
</script>

<template>
  <B24NavigationMenu orientation="vertical" :items="items" class="data-[orientation=vertical]:w-[430px]" />
</template>
```

> [!NOTE]
> Группы разделяются отступами при горизонтальной ориентации и разделителями при вертикальной.

### Свёрнутое меню

При `vertical`-ориентации пропс `collapsed` сворачивает NavigationMenu. Это удобно, например, в боковом меню.

> [!NOTE]
> Пропсы [`tooltip`](#with-tooltip-in-items) и [`popover`](#with-popover-in-items) показывают дополнительную информацию о свёрнутых элементах.

```vue [NavigationMenuCollapsedExample.vue]
<script setup lang="ts">
import type { NavigationMenuItem } from '@bxshefby/b24ui-nuxt'
import ConnectionIcon from '@bitrix24/b24icons-vue/actions/ConnectionIcon'
import Info1Icon from '@bitrix24/b24icons-vue/main/Info1Icon'
import MicrophoneOnIcon from '@bitrix24/b24icons-vue/main/MicrophoneOnIcon'
import CrmMapIcon from '@bitrix24/b24icons-vue/crm/CrmMapIcon'
import Settings5Icon from '@bitrix24/b24icons-vue/editor/Settings5Icon'

const items: NavigationMenuItem[] = [
  {
    label: 'Воронка продаж',
    icon: ConnectionIcon,
    children: [
      {
        label: 'Привлечение лидов',
        description: 'Первичный контакт с потенциальными клиентами'
      },
      {
        label: 'Квалификация лидов',
        description: 'Оценка потенциала клиента'
      },
      {
        label: 'Переговоры',
        description: 'Обсуждение условий сделки',
        icon: MicrophoneOnIcon
      }
    ]
  },
  {
    label: 'Аналитика продаж',
    icon: CrmMapIcon,
    badge: '+3',
    children: [
      {
        label: 'Отчёты по продажам',
        icon: CrmMapIcon,
        active: true,
        badge: 1
      },
      {
        label: 'Ключевые показатели',
        icon: Settings5Icon,
        badge: {
          label: 2,
          color: 'air-primary-copilot' as const
        }
      },
      {
        label: 'Интеграция с CRM'
      }
    ]
  },
  {
    label: 'Ресурсы',
    icon: Info1Icon,
    children: [
      {
        label: 'Поддержка',
        icon: Info1Icon,
        disabled: true,
        to: 'https://helpdesk.bitrix24.com/',
        target: '_blank'
      },
      {
        label: 'Интеграция с REST API'
      }
    ]
  }
]

const isCollapsed = ref(true)
</script>

<template>
  <div class="flex flex-col items-center gap-[4px]">
    <div class="flex flex-row flex-wrap items-center justify-center gap-[4px]">
      <B24Switch v-model="isCollapsed" label="collapsed" />
    </div>
    <B24Separator class="my-[4px]" />
    <B24NavigationMenu
      orientation="vertical"
      :collapsed="isCollapsed"
      :items="items"
      class="data-[collapsed=true]:w-[50px]"
    />
  </div>
</template>
```

### Иконка справа

Пропс `trailing-icon` меняет [иконку](https://bitrix24.github.io/b24icons/icons/) справа у каждого элемента. Иконка показывается, только если у элемента есть дочерние.

> [!TIP]
> Иконку отдельного элемента можно задать и свойством `trailingIcon` в объекте элемента.

```vue
<script setup lang="ts">
import RocketIcon from '@bitrix24/b24icons-vue/main/RocketIcon'
import type { NavigationMenuItem } from '@bxshefby/b24ui-nuxt'

const items = ref<NavigationMenuItem[]>([
  {
    label: 'Управление продажами',
    type: 'trigger',
    children: [
      {
        label: 'Управление лидами'
      },
      {
        label: 'Управление сделками'
      },
      {
        label: 'Воронки'
      },
      {
        label: 'Права доступа'
      }
    ]
  },
  {
    label: 'Совместная работа',
    type: 'trigger',
    children: [
      {
        label: 'Онлайн-офис',
        to: 'https://www.bitrix24.com/tools/communications/online-workspace.php'
      },
      {
        label: 'CoPilot в чате',
        to: 'https://www.bitrix24.com/tools/copilot-ai-powered-tools-for-business.php#copilot-in-chat'
      },
      {
        label: 'useToast',
        to: '/docs/composables/use-toast'
      }
    ]
  },
  {
    label: 'HR и автоматизация',
    type: 'trigger',
    badge: 5,
    active: true,
    children: [
      {
        label: 'Управление сотрудниками',
        to: 'https://www.bitrix24.com/tools/hr_automation/employee-management.php'
      },
      {
        label: 'Культура и вовлечённость',
        to: 'https://www.bitrix24.com/tools/hr_automation/culture-and-engagement.php'
      },
      {
        label: 'Автоматизация',
        to: 'https://www.bitrix24.com/tools/hr_automation/automation.php',
        target: '_blank'
      }
    ]
  }
])
</script>

<template>
  <B24NavigationMenu :trailing-icon="RocketIcon" :items="items" class="w-full justify-center" />
</template>
```

### Область просмотра `2.15+`

Пропс `viewport` управляет отрисовкой области просмотра NavigationMenu, например её `align`.

> [!WARNING]
> Пропс работает только при `orientation` равном `horizontal`.

```vue
<script setup lang="ts">
import type { NavigationMenuItem } from '@bxshefby/b24ui-nuxt'

const items = ref<NavigationMenuItem[]>([
  {
    label: 'Управление продажами',
    type: 'trigger',
    children: [
      {
        label: 'Управление лидами'
      },
      {
        label: 'Управление сделками'
      },
      {
        label: 'Воронки'
      },
      {
        label: 'Права доступа'
      }
    ]
  },
  {
    label: 'Совместная работа',
    type: 'trigger',
    children: [
      {
        label: 'Онлайн-офис',
        to: 'https://www.bitrix24.com/tools/communications/online-workspace.php'
      },
      {
        label: 'CoPilot в чате',
        to: 'https://www.bitrix24.com/tools/copilot-ai-powered-tools-for-business.php#copilot-in-chat'
      },
      {
        label: 'useToast',
        to: '/docs/composables/use-toast'
      }
    ]
  },
  {
    label: 'HR и автоматизация',
    type: 'trigger',
    badge: 5,
    active: true,
    children: [
      {
        label: 'Управление сотрудниками',
        to: 'https://www.bitrix24.com/tools/hr_automation/employee-management.php'
      },
      {
        label: 'Культура и вовлечённость',
        to: 'https://www.bitrix24.com/tools/hr_automation/culture-and-engagement.php'
      },
      {
        label: 'Автоматизация',
        to: 'https://www.bitrix24.com/tools/hr_automation/automation.php',
        target: '_blank'
      }
    ]
  }
])
</script>

<template>
  <B24NavigationMenu :viewport="{align:'start'}" :items="items" class="w-full justify-center" />
</template>
```

### Выгрузка содержимого

Пропс `unmount-on-hide` управляет выгрузкой содержимого. По умолчанию `true`.

```vue
<script setup lang="ts">
import type { NavigationMenuItem } from '@bxshefby/b24ui-nuxt'

const items = ref<NavigationMenuItem[]>([
  {
    label: 'Управление продажами',
    type: 'trigger',
    children: [
      {
        label: 'Управление лидами'
      },
      {
        label: 'Управление сделками'
      },
      {
        label: 'Воронки'
      },
      {
        label: 'Права доступа'
      }
    ]
  },
  {
    label: 'Совместная работа',
    type: 'trigger',
    children: [
      {
        label: 'Онлайн-офис',
        to: 'https://www.bitrix24.com/tools/communications/online-workspace.php'
      },
      {
        label: 'CoPilot в чате',
        to: 'https://www.bitrix24.com/tools/copilot-ai-powered-tools-for-business.php#copilot-in-chat'
      },
      {
        label: 'useToast',
        to: '/docs/composables/use-toast'
      }
    ]
  },
  {
    label: 'HR и автоматизация',
    type: 'trigger',
    badge: 5,
    active: true,
    children: [
      {
        label: 'Управление сотрудниками',
        to: 'https://www.bitrix24.com/tools/hr_automation/employee-management.php'
      },
      {
        label: 'Культура и вовлечённость',
        to: 'https://www.bitrix24.com/tools/hr_automation/culture-and-engagement.php'
      },
      {
        label: 'Автоматизация',
        to: 'https://www.bitrix24.com/tools/hr_automation/automation.php',
        target: '_blank'
      }
    ]
  }
])
</script>

<template>
  <B24NavigationMenu :unmount-on-hide="false" :items="items" class="w-full justify-center" />
</template>
```

> [!NOTE]
> В DOM видно, что содержимое каждого элемента отрисовано.

## Примеры

### Управление активным элементом

Активным элементом (элементами) управляют пропс `default-value` или директива `v-model` со значением `value` элемента. Если `value` не задан, по умолчанию используется `item-${index}` для элементов верхнего уровня и `item-${level}-${index}` для вложенных.

```vue [NavigationMenuModelValueExample.vue]
<script setup lang="ts">
import type { NavigationMenuItem } from '@bxshefby/b24ui-nuxt'
import ConnectionIcon from '@bitrix24/b24icons-vue/actions/ConnectionIcon'
import Info1Icon from '@bitrix24/b24icons-vue/main/Info1Icon'
import MicrophoneOnIcon from '@bitrix24/b24icons-vue/main/MicrophoneOnIcon'
import CrmMapIcon from '@bitrix24/b24icons-vue/crm/CrmMapIcon'
import Settings5Icon from '@bitrix24/b24icons-vue/editor/Settings5Icon'

const items: NavigationMenuItem[] = [
  {
    label: 'Воронка продаж',
    icon: ConnectionIcon,
    children: [
      {
        label: 'Привлечение лидов',
        description: 'Первичный контакт с потенциальными клиентами'
      },
      {
        label: 'Квалификация лидов',
        description: 'Оценка потенциала клиента'
      },
      {
        label: 'Переговоры',
        description: 'Обсуждение условий сделки',
        icon: MicrophoneOnIcon
      }
    ]
  },
  {
    label: 'Аналитика продаж',
    badge: '+3',
    children: [
      {
        label: 'Отчёты по продажам',
        icon: CrmMapIcon,
        active: true,
        badge: 1
      },
      {
        label: 'Ключевые показатели',
        icon: Settings5Icon,
        badge: {
          label: 2,
          color: 'air-primary-copilot' as const
        }
      },
      {
        label: 'Интеграция с CRM'
      }
    ]
  },
  {
    label: 'Ресурсы',
    children: [
      {
        label: 'Поддержка',
        icon: Info1Icon,
        disabled: true,
        to: 'https://helpdesk.bitrix24.com/',
        target: '_blank'
      },
      {
        label: 'Интеграция с REST API'
      }
    ]
  }
]

const active = ref()

defineShortcuts({
  1: () => {
    active.value = 'item-0'
  },
  2: () => {
    active.value = 'item-1'
  },
  3: () => {
    active.value = 'item-2'
  }
})
</script>

<template>
  <B24NavigationMenu v-model="active" :items="items" class="w-full justify-center" />
</template>
```

> [!TIP]
> Пропс `value-key` меняет ключ, по которому сопоставляются элементы при `v-model` или `default-value`.

> [!NOTE]
> В этом примере с помощью [`defineShortcuts`](https://b24-ui.bx-shef.by/raw/docs/composables/define-shortcuts.md) активный элемент переключается нажатием <kbd value="1">
> </kbd>
> , <kbd value="2">
> </kbd>
> или <kbd value="3">
> </kbd>
> .

### С подсказкой в элементах

При `vertical`-ориентации и свёрнутом меню (`collapsed`) пропс `tooltip` со значением `true` показывает [Tooltip](https://b24-ui.bx-shef.by/raw/docs/components/tooltip.md) с подписью элемента. Свойство `tooltip` у отдельного элемента переопределяет подсказку по умолчанию. При `horizontal`-ориентации Tooltip для элементов задаётся свойством `tooltip` у элемента.

> [!NOTE]
> Свойство `tooltip` у элемента всегда показывает подсказку независимо от общего пропса `tooltip`.

Любое свойство компонента [Tooltip](https://b24-ui.bx-shef.by/raw/docs/components/tooltip.md) можно передать глобально или для каждого элемента.

```vue [NavigationMenuCollapsedTooltipExample.vue]
<script setup lang="ts">
import type { NavigationMenuItem, NavigationMenuProps } from '@bxshefby/b24ui-nuxt'
import ConnectionIcon from '@bitrix24/b24icons-vue/actions/ConnectionIcon'
import Info1Icon from '@bitrix24/b24icons-vue/main/Info1Icon'
import MicrophoneOnIcon from '@bitrix24/b24icons-vue/main/MicrophoneOnIcon'
import CrmMapIcon from '@bitrix24/b24icons-vue/crm/CrmMapIcon'
import Settings5Icon from '@bitrix24/b24icons-vue/editor/Settings5Icon'
import GitHubIcon from '@bitrix24/b24icons-vue/social/GitHubIcon'

const items: NavigationMenuItem[] = [
  {
    label: 'Воронка продаж',
    icon: ConnectionIcon,
    children: [
      {
        label: 'Привлечение лидов',
        description: 'Первичный контакт с потенциальными клиентами'
      },
      {
        label: 'Квалификация лидов',
        description: 'Оценка потенциала клиента'
      },
      {
        label: 'Переговоры',
        description: 'Обсуждение условий сделки',
        icon: MicrophoneOnIcon
      }
    ]
  },
  {
    label: 'Аналитика продаж',
    icon: CrmMapIcon,
    badge: '+3',
    children: [
      {
        label: 'Отчёты по продажам',
        icon: CrmMapIcon,
        active: true,
        badge: 1
      },
      {
        label: 'Ключевые показатели',
        icon: Settings5Icon,
        badge: {
          label: 2,
          color: 'air-primary-copilot' as const
        }
      },
      {
        label: 'Интеграция с CRM'
      }
    ]
  },
  {
    label: 'Ресурсы',
    icon: Info1Icon,
    children: [
      {
        label: 'Поддержка',
        icon: Info1Icon,
        disabled: true,
        to: 'https://helpdesk.bitrix24.com/',
        target: '_blank'
      },
      {
        label: 'Интеграция с REST API'
      }
    ]
  },
  {
    label: 'Ресурсы',
    icon: GitHubIcon,
    to: 'https://github.com/bitrix24/b24ui',
    target: '_blank',
    tooltip: {
      text: 'Открыть на GitHub',
      kbds: ['meta', 'G']
    }
  }
]

const orientation = ref<NavigationMenuProps['orientation']>('vertical')
const idCollapsed = ref(true)
const isTooltip = ref(true)
</script>

<template>
  <div class="flex flex-col items-center gap-[4px]">
    <div class="flex flex-row flex-wrap items-center justify-center gap-[4px]">
      <B24Select v-model="orientation" :items="['horizontal', 'vertical']" class="min-w-[175px]" />
      <B24Switch v-model="idCollapsed" label="collapsed" />
      <B24Switch v-model="isTooltip" label="tooltip" />
    </div>
    <B24Separator class="my-[4px]" />
    <B24NavigationMenu
      :orientation="orientation"
      :collapsed="idCollapsed"
      :tooltip="isTooltip"
      :items="items"
      class="data-[collapsed=true]:w-[50px]"
    />
  </div>
</template>
```

### С popover в элементах

При `vertical`-ориентации и свёрнутом меню (`collapsed`) пропс `popover` со значением `true` показывает [Popover](https://b24-ui.bx-shef.by/raw/docs/components/popover.md) с дочерними элементами. Свойство `popover` у отдельного элемента переопределяет popover по умолчанию.

> [!NOTE]
> Свойство `popover` у элемента всегда показывает popover независимо от общего пропса `popover`.

Любое свойство компонента [Popover](https://b24-ui.bx-shef.by/raw/docs/components/popover.md) можно передать глобально или для каждого элемента.

```vue [NavigationMenuCollapsedPopoverExample.vue]
<script setup lang="ts">
import type { NavigationMenuItem } from '@bxshefby/b24ui-nuxt'
import ConnectionIcon from '@bitrix24/b24icons-vue/actions/ConnectionIcon'
import Info1Icon from '@bitrix24/b24icons-vue/main/Info1Icon'
import MicrophoneOnIcon from '@bitrix24/b24icons-vue/main/MicrophoneOnIcon'
import CrmMapIcon from '@bitrix24/b24icons-vue/crm/CrmMapIcon'
import Settings5Icon from '@bitrix24/b24icons-vue/editor/Settings5Icon'

const items: NavigationMenuItem[] = [
  {
    label: 'Воронка продаж',
    icon: ConnectionIcon,
    children: [
      {
        label: 'Привлечение лидов',
        description: 'Первичный контакт с потенциальными клиентами'
      },
      {
        label: 'Квалификация лидов',
        description: 'Оценка потенциала клиента'
      },
      {
        label: 'Переговоры',
        description: 'Обсуждение условий сделки',
        icon: MicrophoneOnIcon
      }
    ]
  },
  {
    label: 'Аналитика продаж',
    icon: CrmMapIcon,
    badge: '+3',
    children: [
      {
        label: 'Отчёты по продажам',
        icon: CrmMapIcon,
        active: true,
        badge: 1
      },
      {
        label: 'Ключевые показатели',
        icon: Settings5Icon,
        badge: {
          label: 2,
          color: 'air-primary-copilot' as const
        }
      },
      {
        label: 'Интеграция с CRM'
      }
    ]
  },
  {
    label: 'Ресурсы',
    icon: Info1Icon,
    children: [
      {
        label: 'Поддержка',
        icon: Info1Icon,
        disabled: true,
        to: 'https://helpdesk.bitrix24.com/',
        target: '_blank'
      },
      {
        label: 'Интеграция с REST API'
      }
    ]
  }
]

const isCollapsed = ref(true)
const isPopover = ref(true)
</script>

<template>
  <div class="flex flex-col items-center gap-[4px]">
    <div class="flex flex-row flex-wrap items-center justify-center gap-[4px]">
      <B24Switch v-model="isCollapsed" label="collapsed" />
      <B24Switch v-model="isPopover" label="popover" />
    </div>
    <B24Separator class="my-[4px]" />
    <B24NavigationMenu
      orientation="vertical"
      :collapsed="isCollapsed"
      :popover="isPopover"
      :items="items"
      class="data-[collapsed=true]:w-[50px]"
    />
  </div>
</template>
```

> [!TIP]
> See: #with-content-slot
> Слот `#content` настраивает содержимое popover при `vertical`-ориентации.

### С чипом в элементах

Свойство `chip` показывает [Chip](https://b24-ui.bx-shef.by/raw/docs/components/chip.md) вокруг иконки элемента; можно передать любые его пропсы.

```vue [NavigationMenuChipItemsExample.vue]
<script setup lang="ts">
import type { NavigationMenuItem, NavigationMenuProps } from '@bxshefby/b24ui-nuxt'
import ConnectionIcon from '@bitrix24/b24icons-vue/actions/ConnectionIcon'
import Info1Icon from '@bitrix24/b24icons-vue/main/Info1Icon'
import MicrophoneOnIcon from '@bitrix24/b24icons-vue/main/MicrophoneOnIcon'
import CrmMapIcon from '@bitrix24/b24icons-vue/crm/CrmMapIcon'
import Settings5Icon from '@bitrix24/b24icons-vue/editor/Settings5Icon'

const items: NavigationMenuItem[] = [
  {
    label: 'Воронка продаж',
    icon: ConnectionIcon,
    chip: { color: 'air-primary-alert' },
    children: [
      {
        label: 'Привлечение лидов',
        description: 'Первичный контакт с потенциальными клиентами'
      },
      {
        label: 'Квалификация лидов',
        description: 'Оценка потенциала клиента'
      },
      {
        label: 'Переговоры',
        description: 'Обсуждение условий сделки',
        chip: { color: 'air-primary-alert' },
        icon: MicrophoneOnIcon
      }
    ]
  },
  {
    label: 'Аналитика продаж',
    icon: CrmMapIcon,
    chip: { color: 'air-primary', text: 3 },
    children: [
      {
        label: 'Отчёты по продажам',
        icon: CrmMapIcon,
        active: true,
        chip: { text: 1 }
      },
      {
        label: 'Ключевые показатели',
        icon: Settings5Icon,
        chip: { color: 'air-primary-copilot', text: 2 }
      },
      {
        label: 'Интеграция с CRM'
      }
    ]
  },
  {
    label: 'Ресурсы',
    icon: Info1Icon,
    chip: true,
    children: [
      {
        label: 'Поддержка',
        icon: Info1Icon,
        disabled: true,
        to: 'https://helpdesk.bitrix24.com/',
        target: '_blank'
      },
      {
        label: 'Интеграция с REST API'
      }
    ]
  }
]

const orientation = ref<NavigationMenuProps['orientation']>('horizontal')
const isCollapsed = ref(false)
const isPopover = ref(false)
</script>

<template>
  <div class="flex flex-col items-center gap-[4px]">
    <div class="flex flex-row flex-wrap items-center justify-center gap-[4px]">
      <B24Select v-model="orientation" :items="['horizontal', 'vertical']" class="min-w-[175px]" />
      <B24Switch v-model="isCollapsed" label="collapsed" />
      <B24Switch v-model="isPopover" label="popover" />
    </div>
    <B24Separator class="my-[4px]" />
    <B24NavigationMenu
      :orientation="orientation"
      :collapsed="isCollapsed"
      :popover="isPopover"
      :items="items"
      class="data-[collapsed=true]:w-[50px]"
    />
  </div>
</template>
```

### С нижней панелью вкладок

Пропс `b24ui` превращает NavigationMenu в мобильную нижнюю панель вкладок с иконками и мелкими подписями.

```vue [NavigationMenuBottomTabBarExample.vue]
<script setup lang="ts">
import type { NavigationMenuItem } from '@bxshefby/b24ui-nuxt'
import HomeIcon from '@bitrix24/b24icons-vue/outline/HomeIcon'
import PlayIcon from '@bitrix24/b24icons-vue/common-service/PlayIcon'
import CompassIcon from '@bitrix24/b24icons-vue/main/CompassIcon'
import BookmarkIcon from '@bitrix24/b24icons-vue/outline/BookmarkIcon'

const items: NavigationMenuItem[] = [
  {
    label: 'Главная',
    icon: HomeIcon,
    active: true
  },
  {
    label: 'Примеры',
    icon: PlayIcon
  },
  {
    label: 'Обзор',
    icon: CompassIcon
  },
  {
    label: 'Библиотека',
    icon: BookmarkIcon
  }
]

const b24UiCustom = ref({
  root: 'justify-around border-t border-(--ui-color-divider-default) py-2',
  link: 'h-[64px]',
  item: 'py-0',
  linkLabelWrapper: 'flex-col gap-1 px-3',
  linkLeadingIcon: 'size-8',
  linkLabel: 'text-[10px]/3 font-normal'
})
</script>

<template>
  <B24NavigationMenu
    :items="items"
    :b24ui="b24UiCustom"
    class="w-full"
  >
    <template #item-leading="{ item, active, b24ui }">
      <template v-if="item.icon">
        <Component
          :is="item.icon"
          class="size-5"
          :class="b24ui.linkLeadingIcon({ class: [b24UiCustom?.linkLeadingIcon], active, disabled: !!item.disabled })"
        />
      </template>
    </template>
  </B24NavigationMenu>
</template>
```

### Со свёрнутыми подписями

Пропс `b24ui` показывает под каждой иконкой подпись в свёрнутом состоянии.

```vue [NavigationMenuCollapsedLabelExample.vue]
<script setup lang="ts">
import type { NavigationMenuItem } from '@bxshefby/b24ui-nuxt'
import HomeIcon from '@bitrix24/b24icons-vue/outline/HomeIcon'
import PlayIcon from '@bitrix24/b24icons-vue/common-service/PlayIcon'
import CompassIcon from '@bitrix24/b24icons-vue/main/CompassIcon'
import BookmarkIcon from '@bitrix24/b24icons-vue/outline/BookmarkIcon'

const items: NavigationMenuItem[] = [
  {
    label: 'Главная',
    icon: HomeIcon,
    active: true
  },
  {
    label: 'Примеры',
    icon: PlayIcon
  },
  {
    label: 'Обзор',
    icon: CompassIcon
  },
  {
    label: 'Библиотека',
    icon: BookmarkIcon
  }
]

const b24UiCustom = ref({
  root: 'w-[76px] ps-0',
  item: 'w-[54px]',
  link: 'h-[54px]',
  linkLabelWrapper: 'h-[44px] w-[44px] flex-col gap-0.5 px-3',
  linkLabel: 'block text-[10px]/3 text-center'
})
</script>

<template>
  <B24NavigationMenu
    collapsed
    orientation="vertical"
    :items="items"
    :b24ui="b24UiCustom"
  />
</template>
```

### С собственным слотом

Свойство `slot` настраивает отдельный элемент.

Вам будут доступны слоты:

- `#{{ item.slot }}`
- `#{{ item.slot }}-leading`
- `#{{ item.slot }}-label`
- `#{{ item.slot }}-trailing`
- `#{{ item.slot }}-content`

```vue [NavigationMenuCustomSlotExample.vue]
<script setup lang="ts">
import type { NavigationMenuItem } from '@bxshefby/b24ui-nuxt'
import ConnectionIcon from '@bitrix24/b24icons-vue/actions/ConnectionIcon'
import Info1Icon from '@bitrix24/b24icons-vue/main/Info1Icon'

const items = [
  {
    label: 'Воронка продаж',
    icon: ConnectionIcon
  },
  {
    label: 'Аналитика продаж',
    badge: '+3'
  },
  {
    label: 'Ресурсы'
  },
  {
    label: 'Поддержка',
    icon: Info1Icon,
    slot: 'support' as const
  }
] satisfies NavigationMenuItem[]
</script>

<template>
  <B24NavigationMenu :items="items" class="w-full justify-center">
    <template #support-trailing>
      <B24Badge label="44" size="sm" />
    </template>
  </B24NavigationMenu>
</template>
```

> [!TIP]
> See: #slots
> Слоты `#item`, `#item-leading`, `#item-label`, `#item-trailing` и `#item-content` настраивают все элементы сразу.

### Со слотом trailing

Слот `#item-trailing` или свойство `slot` (`#{{ item.slot }}-trailing`) добавляет [DropdownMenu](https://b24-ui.bx-shef.by/raw/docs/components/dropdown-menu.md), который появляется при наведении, как в Notion или Linear.

```vue [NavigationMenuTrailingSlotExample.vue]
<script setup lang="ts">
import type { NavigationMenuItem, DropdownMenuItem } from '@bxshefby/b24ui-nuxt'
import FolderIcon from '@bitrix24/b24icons-vue/outline/FolderIcon'
import BookOpenIcon from '@bitrix24/b24icons-vue/crm/BookOpenIcon'
import Share1Icon from '@bitrix24/b24icons-vue/main/Share1Icon'
import TrashcanIcon from '@bitrix24/b24icons-vue/outline/TrashcanIcon'
import PlusLIcon from '@bitrix24/b24icons-vue/outline/PlusLIcon'
import MoreMIcon from '@bitrix24/b24icons-vue/outline/MoreMIcon'

const items: NavigationMenuItem[][] = [
  [
    {
      label: 'Личное',
      type: 'label',
      slot: 'personal-label' as const
    },
    {
      label: 'Дизайн-система',
      icon: FolderIcon,
      active: true
    },
    {
      label: 'Путешествия',
      icon: FolderIcon
    }
  ],
  [
    {
      label: 'Команды',
      type: 'label',
      slot: 'teams-label' as const
    },
    {
      label: 'Разработка',
      icon: FolderIcon
    },
    {
      label: 'Маркетинг',
      icon: FolderIcon
    }
  ]
]

const dropdownItems: DropdownMenuItem[][] = [
  [
    { label: 'Просмотреть проект', icon: BookOpenIcon },
    { label: 'Поделиться проектом', icon: Share1Icon }
  ],
  [
    { label: 'Удалить проект', icon: TrashcanIcon, color: 'air-primary-alert' }
  ]
]
</script>

<template>
  <B24NavigationMenu
    orientation="vertical"
    :items="items"
    :b24ui="{ label: 'flex items-center justify-between gap-1.5 ' }"
    class="w-48"
  >
    <template #personal-label-trailing>
      <B24Button :icon="PlusLIcon" color="air-tertiary" size="xs" />
    </template>

    <template #teams-label-trailing>
      <B24Button :icon="PlusLIcon" color="air-tertiary" size="xs" />
    </template>

    <template #item-trailing>
      <div class="flex -me-1.5 -my-0.5 translate-x-full rtl:-translate-x-full group-hover:translate-x-0 has-data-[state=open]:translate-x-0 transition-transform">
        <B24DropdownMenu
          :items="dropdownItems"
          :content="{ align: 'start' }"
          :modal="false"
          size="xs"
        >
          <B24Button
            as="div"
            :icon="MoreMIcon"
            color="air-tertiary"
            size="xs"
            class="text-description hover:text-label hover:bg-(--ui-color-accent-soft-element-blue)/40 data-[state=open]:bg-(--ui-color-accent-soft-element-blue)/30 me-1.5"
          />
        </B24DropdownMenu>
      </div>
    </template>
  </B24NavigationMenu>
</template>
```

### Со слотом content

Слот `#item-content` или свойство `slot` (`#{{ item.slot }}-content`) настраивает содержимое отдельного элемента.

```vue [NavigationMenuContentSlotExample.vue]
<script setup lang="ts">
import type { NavigationMenuItem } from '@bxshefby/b24ui-nuxt'
import ConnectionIcon from '@bitrix24/b24icons-vue/actions/ConnectionIcon'
import MicrophoneOnIcon from '@bitrix24/b24icons-vue/main/MicrophoneOnIcon'
import GitHubIcon from '@bitrix24/b24icons-vue/social/GitHubIcon'
import CrmMapIcon from '@bitrix24/b24icons-vue/crm/CrmMapIcon'
import Settings5Icon from '@bitrix24/b24icons-vue/editor/Settings5Icon'

const items = [
  {
    label: 'Воронка продаж',
    icon: ConnectionIcon,
    slot: 'pipeline' as const,
    children: [
      {
        label: 'Привлечение лидов',
        description: 'Первичный контакт с потенциальными клиентами'
      },
      {
        label: 'Квалификация лидов',
        description: 'Оценка потенциала клиента'
      },
      {
        label: 'Переговоры',
        description: 'Обсуждение условий сделки',
        icon: MicrophoneOnIcon
      }
    ]
  },
  {
    label: 'Аналитика продаж',
    badge: '+3',
    children: [
      {
        label: 'Отчёты по продажам',
        icon: CrmMapIcon,
        active: true,
        badge: 1
      },
      {
        label: 'Ключевые показатели',
        icon: Settings5Icon,
        badge: {
          label: 2,
          color: 'air-primary-copilot' as const
        }
      },
      {
        label: 'Интеграция с CRM'
      }
    ]
  },
  {
    label: 'GitHub',
    icon: GitHubIcon,
    to: 'https://github.com/bitrix24/b24ui',
    target: '_blank'
  }
] satisfies NavigationMenuItem[]
</script>

<template>
  <B24NavigationMenu
    :items="items"
    :b24ui="{
      viewport: 'sm:w-(--reka-navigation-menu-viewport-width)',
      content: 'sm:w-auto',
      childList: 'sm:w-[380px]'
    }"
    class="w-full justify-center"
  >
    <template #pipeline-content="{ item }">
      <ul class="grid gap-2 p-4 lg:w-[500px] lg:grid-cols-[minmax(0,.75fr)_minmax(0,1fr)]">
        <li class="row-span-3">
          <Placeholder class="size-full min-h-[203px]" />
        </li>

        <li v-for="child in item.children" :key="child.label">
          <B24Link class="group text-(length:--ui-font-size-sm) text-start rounded-(--ui-border-radius-md) p-3 transition-colors hover:no-underline hover:bg-(--ui-color-bg-content-secondary)">
            <p class="font-(--ui-font-weight-medium) text-legend group-hover:text-(--ui-color-accent-main-primary-alt-2)">
              {{ child.label }}
            </p>
            <p class="text-description line-clamp-2">
              {{ child.description }}
            </p>
          </B24Link>
        </li>
      </ul>
    </template>
  </B24NavigationMenu>
</template>
```

> [!NOTE]
> В этом примере класс `sm:w-(--reka-navigation-menu-viewport-width)` добавлен к `viewport`, чтобы ширина была динамической. Для этого у первого дочернего элемента содержимого должна быть задана ширина.

## API

### Пропсы

```ts
/**
 * Props for the NavigationMenu component
 */
interface NavigationMenuProps {
  /**
   * The element or component this component should render as.
   * @default 'div'
   */
  as?: any;
  /**
   * Determines whether a "single" or "multiple" items can be selected at a time.
   * 
   * Only works when `orientation` is `vertical`.
   * @default 'multiple'
   */
  type?: K | undefined;
  /**
   * The controlled value of the active item(s).
   * - In horizontal orientation: always `string`
   * - In vertical orientation with `type="single"`: `string`
   * - In vertical orientation with `type="multiple"`: `string[]`
   * 
   * Use this when you need to control the state of the items. Can be binded with `v-model`
   */
  modelValue?: NavigationMenuModelValue<K, O> | undefined;
  /**
   * The default active value of the item(s).
   * - In horizontal orientation: always `string`
   * - In vertical orientation with `type="single"`: `string`
   * - In vertical orientation with `type="multiple"`: `string[]`
   * 
   * Use when you do not need to control the state of the item(s).
   */
  defaultValue?: NavigationMenuModelValue<K, O> | undefined;
  /**
   * The icon displayed to open the menu.
   * @default icons.chevronDown
   */
  trailingIcon?: (props: HTMLAttributes & VNodeProps & {}, ctx: Omit<{ attrs: Attrs; slots: Readonly<InternalSlots>; emit: (event: string, ...args: any[]) => void; expose: <Exposed extends Record<string, any> = Record<...>>(exposed?: Exposed | undefined) => void; }, "expose">): any | undefined;
  /**
   * The icon displayed when the item is an external link.
   * Set to `false` to hide the external icon.
   * @default true
   */
  externalIcon?: boolean | IconComponent | undefined;
  items?: T | undefined;
  /**
   * The orientation of the menu.
   * @default 'horizontal'
   */
  orientation?: O | undefined;
  /**
   * Collapse the navigation menu to only show icons.
   * Only works when `orientation` is `vertical`.
   * @default false
   */
  collapsed?: boolean | undefined;
  /**
   * Display a tooltip on the items with the label of the item.
   * Only works when `orientation` is `vertical` and `collapsed` is `true`.
   * `{ delayDuration: 0, content: { side: 'right' } }`
   * @default false
   */
  tooltip?: boolean | TooltipProps | undefined;
  /**
   * Display a popover on the items when the menu is collapsed with the children list.
   * `{ mode: 'hover', content: { side: 'right', align: 'center', alignOffset: 2 } }`
   * @default false
   */
  popover?: boolean | PopoverProps<PopoverMode> | undefined;
  /**
   * The content of the menu.
   */
  content?: Omit<NavigationMenuContentProps, "as" | "asChild" | "forceMount"> & Partial<EmitsToProps<DismissableLayerEmits>> | undefined;
  /**
   * The viewport of the menu.
   * Only works when `orientation` is `horizontal`.
   * `{ align: 'center' }`
   */
  viewport?: Omit<NavigationMenuViewportProps, "as" | "asChild" | "forceMount"> | undefined;
  /**
   * The key used to get the value from the item.
   * @default 'value'
   */
  valueKey?: keyof Extract<NestedItem<T>, object> & string | DotPathKeys<Extract<NestedItem<T>, object>> | undefined;
  /**
   * The key used to get the label from the item.
   * @default 'label'
   */
  labelKey?: keyof Extract<NestedItem<T>, object> & string | DotPathKeys<Extract<NestedItem<T>, object>> | undefined;
  b24ui?: { root?: SlotClass; list?: SlotClass; label?: SlotClass; item?: SlotClass; link?: SlotClass; linkLeadingIcon?: SlotClass; linkLeadingAvatar?: SlotClass; linkLeadingAvatarSize?: SlotClass; linkLeadingChipSize?: SlotClass; linkLeadingHint?: SlotClass; linkLeadingBadge?: SlotClass; linkLeadingBadgeSize?: SlotClass; linkTrailing?: SlotClass; linkTrailingIcon?: SlotClass; linkLabel?: SlotClass; linkLabelWrapper?: SlotClass; linkLabelExternalIcon?: SlotClass; childList?: SlotClass; childLabel?: SlotClass; childItem?: SlotClass; childLink?: SlotClass; childLinkWrapper?: SlotClass; childLinkIcon?: SlotClass; childLinkHint?: SlotClass; childLinkBadge?: SlotClass; childLinkBadgeSize?: SlotClass; childLinkLabel?: SlotClass; childLinkLabelExternalIcon?: SlotClass; separator?: SlotClass; popoverWrapper?: SlotClass; viewportWrapper?: SlotClass; viewport?: SlotClass; content?: SlotClass; } | undefined;
  /**
   * The duration from when the pointer enters the trigger until the tooltip gets opened.
   * @default 0
   */
  delayDuration?: number | undefined;
  /**
   * If `true`, menu cannot be open by click on trigger
   * @default false
   */
  disableClickTrigger?: boolean | undefined;
  /**
   * If `true`, menu cannot be open by hover on trigger
   * @default false
   */
  disableHoverTrigger?: boolean | undefined;
  /**
   * How much time a user has to enter another trigger without incurring a delay again.
   * @default 300
   */
  skipDelayDuration?: number | undefined;
  /**
   * If `true`, menu will not close during pointer leave event
   * @default false
   */
  disablePointerLeaveClose?: boolean | undefined;
  /**
   * When `true`, the element will be unmounted on closed state.
   * @default true
   */
  unmountOnHide?: boolean | undefined;
  /**
   * When `true`, prevents the user from interacting with the accordion and all its items
   * @default false
   */
  disabled?: boolean | undefined;
  /**
   * When type is "single", allows closing content when clicking trigger for an open item.
   * When type is "multiple", this prop has no effect.
   * @default true
   */
  collapsible?: boolean | undefined;
}
```

### Слоты

```ts
/**
 * Slots for the NavigationMenu component
 */
interface NavigationMenuSlots {
  item(): any;
  item-leading(): any;
  item-label(): any;
  item-trailing(): any;
  item-content(): any;
  list-leading(): any;
  list-trailing(): any;
}
```

### События

```ts
/**
 * Emitted events for the NavigationMenu component
 */
interface NavigationMenuEmits {
  update:modelValue: (payload: [value: NavigationMenuModelValue<K, O> | undefined]) => void;
}
```

## Тема

```ts [app.config.ts]
export default defineAppConfig({
  b24ui: {
    navigationMenu: {
      slots: {
        root: 'relative flex [&>div]:min-w-0 font-[family-name:var(--ui-font-family-secondary)]',
        list: 'isolate min-w-0',
        label: 'w-full h-5.5 overflow-hidden mt-2.5 opacity-70 text-legend text-(length:--ui-font-size-sm)',
        item: 'min-w-0',
        link: 'min-w-9.5 w-full max-w-full p-0 m-0 group relative cursor-pointer flex items-center gap-0.5 font-(--ui-font-weight-normal) text-(length:--ui-font-size-lg) focus:outline-none focus-visible:rounded-(--menu-item-border-radius) focus-visible:outline-none focus-visible:ring-inset focus-visible:ring-1 focus-visible:ring-(--ui-color-base-4) rounded-(--menu-item-border-radius) text-(--menu-item-color) bg-(--menu-item-background) hover:bg-(--menu-item-background-hover) data-[state=open]:bg-(--menu-item-background-hover) border-0',
        linkLeadingIcon: 'shrink-0 size-6.5',
        linkLeadingAvatar: 'shrink-0 size-5',
        linkLeadingAvatarSize: '2xs',
        linkLeadingChipSize: 'sm',
        linkLeadingHint: 'inline-flex m-0 absolute -top-[5px] left-2 text-(length:--ui-font-size-4xs) leading-2 font-semibold text-description uppercase ml-px',
        linkLeadingBadge: 'inline-flex m-0 absolute',
        linkLeadingBadgeSize: 'xs',
        linkTrailing: 'group inline-flex mt-0.5 items-center',
        linkTrailingIcon: 'shrink-0 size-[25px] text-(--ui-color-base-5)',
        linkLabel: 'truncate',
        linkLabelWrapper: 'flex items-center rtl:flex-row-reverse',
        linkLabelExternalIcon: 'ml-auto inline-block size-[25px] text-(--ui-color-base-5)',
        childList: 'isolate',
        childLabel: '',
        childItem: 'h-9 mt-(--menu-item-block-stack-space)',
        childLink: 'group relative size-full flex flex-row rtl:flex-row-reverse items-center transition-colors gap-2 text-start cursor-pointer select-none outline-none data-disabled:cursor-not-allowed data-disabled:opacity-30 transition-colors',
        childLinkWrapper: 'min-w-0 flex-1 flex flex-row items-center justify-start rtl:justify-end gap-2',
        childLinkIcon: 'size-[25px] shrink-0 text-(--ui-color-base-5)',
        childLinkHint: 'inline-flex m-0 absolute -top-0.5 left-6 text-(length:--ui-font-size-4xs) leading-2 font-semibold text-description uppercase ml-px',
        childLinkBadge: 'inline-flex m-0',
        childLinkBadgeSize: 'xs',
        childLinkLabel: 'truncate ms-0.5 -mt-px',
        childLinkLabelExternalIcon: 'inline-block size-[25px] text-(--ui-color-base-5)',
        separator: 'h-px bg-(--leftmenu-bg-divider) my-4',
        popoverWrapper: 'px-0 py-(--menu-popup-padding)',
        viewportWrapper: 'absolute top-[53px] start-0 flex w-full',
        viewport: 'relative w-full base-mode bg-(--ui-color-bg-content-primary) shadow-(--popup-window-box-shadow) h-(--reka-navigation-menu-viewport-height) w-(--reka-navigation-menu-viewport-width) left-(--reka-navigation-menu-viewport-left) rtl:left-auto rtl:right-[calc(100%-var(--reka-navigation-menu-viewport-left)-var(--reka-navigation-menu-viewport-width))] rounded-(--ui-border-radius-xl) will-change-[opacity] transition-[width,height,left,right] duration-200 motion-reduce:transition-none origin-[top_center] z-1 overflow-x-hidden overflow-y-auto scrollbar-thin',
        content: ''
      },
      variants: {
        orientation: {
          horizontal: {
            root: 'relative h-full items-center justify-between',
            list: 'flex items-center gap-x-1 h-full',
            item: 'empty:hidden',
            link: 'menu-item-horizontal h-8 min-h-8 px-2.5 leading-7 border border-(--menu-item-background) hover:border-(--ui-color-design-plain-na-focused-stroke) data-[state=open]:bg-(--ui-color-design-plain-na-focused-stroke) bitrix-mobile:px-3 bitrix-mobile:h-8.5 bitrix-mobile:min-h-8.5 bitrix-mobile:text-(--ui-color-base-4) bitrix-mobile:border-(--ui-color-base-7) bitrix-mobile:leading-6 bitrix-mobile:text-(length:--ui-font-size-md) bitrix-mobile:scale-x-[0.92]',
            linkTrailingIcon: 'size-4',
            linkLeadingBadge: '-top-1.5 -right-3.5 -translate-x-1/2',
            linkLabelWrapper: 'gap-1 truncate justify-between',
            childList: 'grid px-0 py-(--menu-popup-padding)',
            childLink: 'px-4.5 min-w-[195px] whitespace-nowrap font-[family-name:var(--ui-font-family-primary)] text-(length:--ui-font-size-md) text-(--ui-color-base-1) hover:text-(--ui-color-base-1) data-highlighted:text-(--ui-color-base-1) data-[state=open]:text-(--ui-color-base-1) hover:bg-(--ui-color-base-black-fixed)/3 dark:hover:bg-(--ui-color-base-black-fixed) active:bg-(--ui-color-base-black-fixed)/6 dark:active:bg-(--ui-color-base-black-fixed) data-highlighted:not-active:bg-(--ui-color-base-black-fixed)/3 dark:data-highlighted:not-active:bg-(--ui-color-base-black-fixed) data-[state=open]active:bg-(--ui-color-base-black-fixed)/6 dark:data-[state=open]active:bg-(--ui-color-base-black-fixed) bitrix-mobile:data-[state=open]:bg-(--ui-color-bg-state-hover-default)',
            childLinkLabel: ''
          },
          vertical: {
            root: 'flex-col w-full ps-0 pe-0 rtl:pe-0 rtl:ps-0',
            list: 'flex flex-col',
            item: 'mt-(--menu-item-block-stack-space) data-[state=open]:rounded-(--menu-item-border-radius) data-[state=open]:border-(length:--leftmenu-group-stroke-weight) data-[state=open]:border-(--leftmenu-group-stroke)',
            link: 'menu-item-vertical h-9.5 min-h-9.5 p-1.5 flex-row rtl:flex-row-reverse justify-between data-[state=open]:text-(length:--ui-font-size-sm) data-[state=open]:opacity-70',
            linkLeadingIcon: '',
            linkTrailingIcon: 'size-5 group-data-[state=open]:rotate-180 transition-transform duration-200 motion-reduce:transition-none',
            linkLeadingBadge: '-top-2 left-6 -translate-x-1/2',
            linkLabelWrapper: 'relative h-5.5 w-full',
            childList: '',
            childLink: 'px-4.5 min-w-[195px] whitespace-nowrap font-[family-name:var(--ui-font-family-primary)] text-(length:--ui-font-size-md) text-(--ui-color-base-1) hover:text-(--ui-color-base-1) data-highlighted:text-(--ui-color-base-1) data-[state=open]:text-(--ui-color-base-1) hover:bg-(--ui-color-divider-optical-1-alt) data-highlighted:bg-(--ui-color-divider-optical-1-alt) data-[state=open]:bg-(--ui-color-divider-optical-1-alt)',
            childLabel: 'w-full min-w-[195px] h-(--popup-window-delimiter-section-height) px-4.5 mt-(--menu-item-block-stack-space) flex flex-row rtl:flex-row-reverse items-center select-none outline-none whitespace-nowrap text-start text-(length:--ui-size-sm) text-legend font-(--ui-font-weight-normal) after:ms-2.5 after:block after:flex-1 after:min-w-[15px] after:h-px after:bg-(--ui-color-divider-vibrant-default)'
          }
        },
        active: {
          true: {
            link: '',
            childLink: 'bg-(--ui-color-base-black-fixed)/3',
            childLinkIcon: ''
          },
          false: {
            linkLeadingIcon: 'text-(--ui-color-base-5)',
            childLinkIcon: 'text-(--ui-color-base-5)'
          }
        },
        disabled: {
          true: {
            link: 'cursor-not-allowed opacity-75'
          }
        },
        level: {
          true: ''
        },
        collapsed: {
          true: ''
        }
      },
      compoundVariants: [
        {
          orientation: 'horizontal',
          class: {
            childList: '',
            content: 'w-60'
          }
        },
        {
          orientation: 'vertical',
          collapsed: false,
          class: {
            item: 'data-[state=open]:bg-(--leftmenu-group-bg)',
            childList: 'mb-0.5',
            childItem: '',
            linkLeadingAvatar: 'me-1',
            content: 'motion-safe:data-[state=open]:animate-[collapsible-down_200ms_var(--ease-out)] motion-safe:data-[state=closed]:animate-[collapsible-up_200ms_var(--ease-out)] overflow-hidden',
            linkLabel: 'ms-[9px]'
          }
        },
        {
          orientation: 'vertical',
          collapsed: true,
          class: {
            childList: 'grid px-0 py-(--menu-popup-padding)',
            linkLeadingAvatar: 'shrink-0 mx-auto',
            linkLabel: 'hidden',
            linkLabelExternalIcon: 'hidden',
            linkTrailing: 'hidden'
          }
        },
        {
          orientation: 'vertical',
          collapsed: false,
          class: {
            link: 'data-[state=open]:-mt-(--leftmenu-group-stroke-weight) data-[state=open]:-mx-(--leftmenu-group-stroke-weight)'
          }
        },
        {
          disabled: false,
          active: false,
          class: {
            link: 'transition-colors',
            linkLeadingIcon: 'group-hover:text-(--ui-color-design-selection-content-icon)'
          }
        },
        {
          active: true,
          class: {
            link: 'leading-9 text-(--menu-item-color-active) bg-(--menu-item-background-active)'
          }
        },
        {
          active: true,
          orientation: 'horizontal',
          class: {
            link: 'leading-7 menu-item-horizontal-active border-(--menu-item-border) bitrix-mobile:text-(--ui-color-base-2) bitrix-mobile:bg-transparent bitrix-mobile:border-(--ui-color-base-2)'
          }
        },
        {
          active: true,
          orientation: 'vertical',
          class: {
            link: 'menu-item-vertical-active'
          }
        }
      ],
      defaultVariants: {}
    }
  }
})
```

## Sitemap

See the full [sitemap](/sitemap.md) for all pages.
