v2.15.0

NavigationMenu

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

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

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

<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>
<script setup lang="ts">
import { ref } from 'vue'
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
  • hint?: string
  • tooltip?: TooltipProps
  • popover?: PopoverProps
  • trailingIcon?: IconComponent
  • type?: 'label' | 'trigger' | 'link'
  • defaultOpen?: boolean
  • open?: boolean
  • value?: string
  • disabled?: boolean
  • slot?: string
  • viewportRtl?: boolean
  • 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, например to, target и другие.

<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>
<script setup lang="ts">
import { ref } from 'vue'
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>
В пропс items можно передать и массив массивов, чтобы показать группы элементов.
Подменю задаются плоским массивом объектов children:
  • label: string
  • icon?: IconComponent
  • onSelect?(e: Event): void
  • class?: any
Группировка заканчивается на верхнем уровне. В отличие от items, children принимает только плоский массив: вложенный массив разворачивается и отрисовывается без разделителя, а в режиме разработки в консоль пишется предупреждение.

Ориентация

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

При вертикальной ориентации каждая группа отображается компонентом Accordion. Состоянием открытия каждого элемента управляют свойства open и defaultOpen, а поведением — пропсы collapsible и type.
При вертикальной ориентации и несвёрнутом меню (collapsed не задан) дочерние элементы отрисовываются рекурсивно как обычные элементы, поэтому их стилизует b24ui.link. b24ui.childLink применяется только к content в horizontal-ориентации и к popover при collapsed.
У последнего элемента меню верхнего уровня нужно задать viewportRtl, чтобы выпадающее меню позиционировалось правильно.
<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>
<script setup lang="ts">
import { ref } from 'vue'
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>
Группы разделяются отступами при горизонтальной ориентации и разделителями при вертикальной.

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

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

Пропсы tooltip и popover показывают дополнительную информацию о свёрнутых элементах.
<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>
<script setup lang="ts">
import { ref } from 'vue'
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 меняет иконку справа у каждого элемента. Иконка показывается, только если у элемента есть дочерние.

Иконку отдельного элемента можно задать и свойством trailingIcon в объекте элемента.
<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>
<script setup lang="ts">
import { ref } from 'vue'
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.

Пропс работает только при orientation равном horizontal.
<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>
<script setup lang="ts">
import { ref } from 'vue'
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.

<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>
<script setup lang="ts">
import { ref } from 'vue'
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>
В DOM видно, что содержимое каждого элемента отрисовано.

Примеры

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

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

<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>
<script setup lang="ts">
import { ref } from 'vue'
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>
Пропс value-key меняет ключ, по которому сопоставляются элементы при v-model или default-value.
В этом примере с помощью defineShortcuts активный элемент переключается нажатием 1, 2 или 3.

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

При vertical-ориентации и свёрнутом меню (collapsed) пропс tooltip со значением true показывает Tooltip с подписью элемента. Свойство tooltip у отдельного элемента переопределяет подсказку по умолчанию. При horizontal-ориентации Tooltip для элементов задаётся свойством tooltip у элемента.

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

Любое свойство компонента Tooltip можно передать глобально или для каждого элемента.

<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>
<script setup lang="ts">
import { ref } from 'vue'
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 с дочерними элементами. Свойство popover у отдельного элемента переопределяет popover по умолчанию.

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

Любое свойство компонента Popover можно передать глобально или для каждого элемента.

<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>
<script setup lang="ts">
import { ref } from 'vue'
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>
Слот #content настраивает содержимое popover при vertical-ориентации.

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

Свойство chip показывает Chip вокруг иконки элемента; можно передать любые его пропсы.

<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>
<script setup lang="ts">
import { ref } from 'vue'
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 в мобильную нижнюю панель вкладок с иконками и мелкими подписями.

<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>
<script setup lang="ts">
import { ref, h } from 'vue'
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 показывает под каждой иконкой подпись в свёрнутом состоянии.

<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>
<script setup lang="ts">
import { ref, h } from 'vue'
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
<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>
Слоты #item, #item-leading, #item-label, #item-trailing и #item-content настраивают все элементы сразу.

Со слотом trailing

Слот #item-trailing или свойство slot (#{{ item.slot }}-trailing) добавляет DropdownMenu, который появляется при наведении, как в Notion или Linear.

<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) настраивает содержимое отдельного элемента.

<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>
В этом примере класс sm:w-(--reka-navigation-menu-viewport-width) добавлен к viewport, чтобы ширина была динамической. Для этого у первого дочернего элемента содержимого должна быть задана ширина.

API

Пропсы

Prop Default Type
as'div'any

The element or component this component should render as.

type'multiple' K

Determines whether a "single" or "multiple" items can be selected at a time.

Only works when orientation is vertical.

modelValue NavigationMenuModelValue<K, O>

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

defaultValue NavigationMenuModelValue<K, O>

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).

trailingIconicons.chevronDownIconComponent

The icon displayed to open the menu.

externalIcontrueIconComponent

The icon displayed when the item is an external link. Set to false to hide the external icon.

items T
orientation'horizontal' O

The orientation of the menu.

collapsedfalseboolean

Collapse the navigation menu to only show icons. Only works when orientation is vertical.

tooltipfalseboolean | TooltipProps

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' } }

popoverfalseboolean | PopoverProps<PopoverMode>

Display a popover on the items when the menu is collapsed with the children list. { mode: 'hover', content: { side: 'right', align: 'center', alignOffset: 2 } }

content NavigationMenuContentProps & Partial<EmitsToProps<DismissableLayerEmits>>

The content of the menu.

viewport NavigationMenuViewportProps

The viewport of the menu. Only works when orientation is horizontal. { align: 'center' }

valueKey'value' keyof Extract<NestedItem<T>, object> & string | DotPathKeys<Extract<NestedItem<T>, object>>

The key used to get the value from the item.

labelKey'label' keyof Extract<NestedItem<T>, object> & string | DotPathKeys<Extract<NestedItem<T>, object>>

The key used to get the label from the item.

delayDuration0 number

The duration from when the pointer enters the trigger until the tooltip gets opened.

disableClickTriggerfalseboolean

If true, menu cannot be open by click on trigger

disableHoverTriggerfalseboolean

If true, menu cannot be open by hover on trigger

skipDelayDuration300 number

How much time a user has to enter another trigger without incurring a delay again.

disablePointerLeaveClosefalseboolean

If true, menu will not close during pointer leave event

unmountOnHidetrueboolean

When true, the element will be unmounted on closed state.

disabledfalseboolean

When true, prevents the user from interacting with the accordion and all its items

collapsibletrueboolean

When type is "single", allows closing content when clicking trigger for an open item. When type is "multiple", this prop has no effect.

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; }

Слоты

Slot Type
item{ item: NestedItem<T>; index: number; active: boolean; b24ui: object; }
item-leading{ item: NestedItem<T>; index: number; active: boolean; b24ui: object; }
item-label{ item: NestedItem<T>; index: number; active: boolean; }
item-trailing{ item: NestedItem<T>; index: number; active: boolean; b24ui: object; }
item-content{ item: NestedItem<T>; index: number; active: boolean; b24ui: object; }
list-leading{}
list-trailing{}

События

Event Type
update:modelValue[value: NavigationMenuModelValue<K, O> | undefined]

Тема

https://github.com/bx-shef/b24-ui/tree/main/src/theme/navigation-menu.ts
export default {
  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: {}
}