---
title: "InputMenu"
description: "Поле ввода с подсказками автодополнения в реальном времени."
canonical_url: "https://b24-ui.bx-shef.by/docs/components/input-menu"
---
# InputMenu

> Поле ввода с подсказками автодополнения в реальном времени.

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

Директива `v-model` управляет значением InputMenu, а пропс `default-value` задаёт начальное значение, когда управлять состоянием не нужно.

```vue
<script setup lang="ts">
const items = ref([
  'Backlog',
  'Todo',
  'In Progress',
  'Done'
])
const value = ref('Backlog')
</script>

<template>
  <B24InputMenu v-model="value" :items="items" />
</template>
```

> [!TIP]
> Используйте его вместо [`Input`](https://b24-ui.bx-shef.by/raw/docs/components/input.md), чтобы получить возможности автодополнения компонента [`Combobox`](https://reka-ui.com/docs/components/combobox) из Reka UI.

> [!NOTE]
> Компонент похож на [`SelectMenu`](https://b24-ui.bx-shef.by/raw/docs/components/select-menu.md), но использует Input вместо Select.

### Элементы

Пропс `items` принимает массив строк, чисел или булевых значений:

```vue
<script setup lang="ts">
const items = ref([
  'Backlog',
  'Todo',
  'In Progress',
  'Done'
])
const value = ref('Backlog')
</script>

<template>
  <B24InputMenu v-model="value" :items="items" />
</template>
```

Можно передать и массив объектов со свойствами:

- `label?: string`
- [`value?: string`](#value-key)
- [`type?: "label" | "separator" | "item"`](#with-items-type)
- [`icon?: IconComponent`](#with-icons-in-items)
- [`avatar?: AvatarProps`](#with-avatar-in-items)
- [`color?: InputMenu['color']`](#with-colors-items)
- [`chip?: ChipProps`](#with-chip-in-items)
- `disabled?: boolean`
- `onSelect?: (e: Event) => void`
- `class?: any`
- `b24ui?: { tagsItem?: ClassNameValue, tagsItemText?: ClassNameValue, tagsItemDelete?: ClassNameValue, tagsItemDeleteIcon?: ClassNameValue, label?: ClassNameValue, separator?: ClassNameValue, item?: ClassNameValue, itemLeadingIcon?: ClassNameValue, itemLeadingAvatarSize?: ClassNameValue, itemLeadingAvatar?: ClassNameValue, itemLeadingChip?: ClassNameValue, itemLeadingChipSize?: ClassNameValue, itemLabel?: ClassNameValue, itemTrailing?: ClassNameValue, itemTrailingIcon?: ClassNameValue }`

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

const items = ref<InputMenuItem[]>([
  {
    label: 'Backlog'
  },
  {
    label: 'Todo'
  },
  {
    label: 'In Progress'
  },
  {
    label: 'Done'
  }
])
const value = ref({
  label: 'Todo'
})
</script>

<template>
  <B24InputMenu v-model="value" :items="items" />
</template>
```

В пропс `items` можно передать и массив массивов.
Тип элемента `separator` задаёт разделитель.

```vue
<script setup lang="ts">
const items = ref([
  [
    'Apple',
    'Banana',
    'Blueberry',
    'Grapes',
    'Pineapple'
  ],
  [
    {
      type: 'separator'
    },
    'Aubergine',
    'Broccoli',
    'Carrot',
    'Courgette',
    'Leek'
  ]
])
const value = ref('Apple')
</script>

<template>
  <B24InputMenu v-model="value" :items="items" />
</template>
```

### Ключ значения

Пропс `value-key` позволяет привязать одно свойство объекта вместо всего объекта. По умолчанию `undefined`.

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

const items = ref<InputMenuItem[]>([
  {
    label: 'Backlog',
    id: 'backlog'
  },
  {
    label: 'Todo',
    id: 'todo'
  },
  {
    label: 'In Progress',
    id: 'in_progress'
  },
  {
    label: 'Done',
    id: 'done'
  }
])
const value = ref('todo')
</script>

<template>
  <B24InputMenu v-model="value" value-key="id" :items="items" />
</template>
```

> [!TIP]
> Пропс `by` сравнивает объекты по полю, а не по ссылке, когда `model-value` — объект.

> [!NOTE]
> Слоты `#leading`, `#default` и `#trailing` получают выбранный элемент как `item`, поэтому остальные его свойства доступны, даже когда `model-value` хранит только ключ.

### Множественный выбор

Пропс `multiple` разрешает выбрать несколько элементов; выбранные элементы показываются как теги.

```vue
<script setup lang="ts">
const items = ref([
  'Backlog',
  'Todo',
  'In Progress',
  'Done'
])
const value = ref([
  'Backlog',
  'Todo'
])
</script>

<template>
  <B24InputMenu v-model="value" multiple :items="items" />
</template>
```

> [!CAUTION]
> В `default-value` или `v-model` нужно передать массив.

### Иконка удаления

С `multiple` пропс `delete-icon` меняет [иконку](https://bitrix24.github.io/b24icons/icons/) удаления в тегах.

```vue
<script setup lang="ts">
import RocketIcon from '@bitrix24/b24icons-vue/main/RocketIcon'

const items = ref([
  'Backlog',
  'Todo',
  'In Progress',
  'Done'
])
const value = ref([
  'Backlog',
  'Todo'
])
</script>

<template>
  <B24InputMenu v-model="value" multiple :delete-icon="RocketIcon" :items="items" />
</template>
```

### Плейсхолдер

Пропс `placeholder` задаёт текст плейсхолдера.

```vue
<script setup lang="ts">
const items = ref([
  'Backlog',
  'Todo',
  'In Progress',
  'Done'
])
</script>

<template>
  <B24InputMenu placeholder="Выберите статус" :items="items" />
</template>
```

### Автодополнение

Пропс `mode` со значением `autocomplete` превращает InputMenu в поле свободного ввода с подсказками. `modelValue` становится введённым текстом (`string`), а не выбранным элементом.

```vue [InputMenuAutocompleteExample.vue]
<script setup lang="ts">
const items = ref(['Бэклог', 'К выполнению', 'В работе', 'Готово'])
const value = ref('')
</script>

<template>
  <B24InputMenu
    v-model="value"
    mode="autocomplete"
    :items="items"
    :content="{ hideWhenEmpty: true }"
    placeholder="Введите статус..."
  />
</template>
```

> [!CAUTION]
> При `mode` равном `autocomplete` пропсы `multiple`, `by`, `resetSearchTermOnSelect` и `resetModelValueOnClear` не применяются.

> [!TIP]
> Пропс `content.hideWhenEmpty` скрывает меню, когда подходящих подсказок нет.

### Содержимое

Пропс `content` управляет отрисовкой содержимого InputMenu, например его `align` или `side`.

```vue
<script setup lang="ts">
const items = ref([
  'Backlog',
  'Todo',
  'In Progress',
  'Done'
])
const value = ref('Backlog')
</script>

<template>
  <B24InputMenu v-model="value" :content="{align:'center',side:'bottom',sideOffset:8}" :items="items" />
</template>
```

### Стрелка

Пропс `arrow` показывает стрелку у InputMenu.

```vue
<script setup lang="ts">
const items = ref([
  'Backlog',
  'Todo',
  'In Progress',
  'Done'
])
const value = ref('Backlog')
</script>

<template>
  <B24InputMenu v-model="value" arrow :items="items" />
</template>
```

### Цвет

Пропс `color` меняет цвет кольца, когда InputMenu в фокусе.

```vue
<script setup lang="ts">
const items = ref([
  'Backlog',
  'Todo',
  'In Progress',
  'Done'
])
const value = ref('Backlog')
</script>

<template>
  <B24InputMenu v-model="value" color="air-primary-copilot" highlight :items="items" />
</template>
```

> [!NOTE]
> Пропс `highlight` здесь показывает состояние фокуса. Внутри компонента он включается при ошибке валидации.

### Тег

Свойство `tag` показывает [Badge](https://b24-ui.bx-shef.by/raw/docs/components/badge.md) поверх Input.

```vue
<script setup lang="ts">
const items = ref([
  'Backlog',
  'Todo',
  'In Progress',
  'Done'
])
const value = ref('Backlog')
</script>

<template>
  <B24InputMenu v-model="value" tag="заметка" color="air-primary-warning" highlight placeholder="Search..." :items="items" />
</template>
```

> [!NOTE]
> Пропс `highlight` здесь показывает состояние фокуса. Внутри компонента он включается при ошибке валидации.

Свойство `tagColor` задаёт цвет Badge.

```vue
<script setup lang="ts">
const items = ref([
  'Backlog',
  'Todo',
  'In Progress',
  'Done'
])
const value = ref('Backlog')
</script>

<template>
  <B24InputMenu v-model="value" tag="заметка" tag-color="air-secondary-alert" color="air-primary-warning" highlight placeholder="Search..." :items="items" />
</template>
```

> [!NOTE]
> Пропс `highlight` здесь показывает состояние фокуса. Внутри компонента он включается при ошибке валидации.

### Размер

Пропс `size` меняет размер InputMenu.

```vue
<script setup lang="ts">
const items = ref([
  'Backlog',
  'Todo',
  'In Progress',
  'Done'
])
const value = ref('Backlog')
</script>

<template>
  <B24InputMenu v-model="value" size="xl" :items="items" />
</template>
```

### Иконка

Пропс `icon` показывает [иконку](https://bitrix24.github.io/b24icons/icons/) внутри InputMenu.

```vue
<script setup lang="ts">
import RocketIcon from '@bitrix24/b24icons-vue/main/RocketIcon'

const items = ref([
  'Backlog',
  'Todo',
  'In Progress',
  'Done'
])
const value = ref('Backlog')
</script>

<template>
  <B24InputMenu v-model="value" :icon="RocketIcon" size="md" :items="items" />
</template>
```

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

Пропс `trailing-icon` меняет [иконку](https://bitrix24.github.io/b24icons/icons/) справа.

```vue
<script setup lang="ts">
import RocketIcon from '@bitrix24/b24icons-vue/main/RocketIcon'

const items = ref([
  'Backlog',
  'Todo',
  'In Progress',
  'Done'
])
const value = ref('Backlog')
</script>

<template>
  <B24InputMenu v-model="value" :trailing-icon="RocketIcon" size="md" :items="items" />
</template>
```

### Иконка выбранного элемента

Пропс `selected-icon` меняет [иконку](https://bitrix24.github.io/b24icons/icons/) выбранного элемента.

```vue
<script setup lang="ts">
import RocketIcon from '@bitrix24/b24icons-vue/main/RocketIcon'

const items = ref([
  'Backlog',
  'Todo',
  'In Progress',
  'Done'
])
const value = ref('Backlog')
</script>

<template>
  <B24InputMenu v-model="value" :selected-icon="RocketIcon" size="md" :items="items" />
</template>
```

### Очистка

Пропс `clear` показывает кнопку очистки, когда выбрано значение.

```vue
<script setup lang="ts">
const items = ref([
  'Backlog',
  'Todo',
  'In Progress',
  'Done'
])
const value = ref('Backlog')
</script>

<template>
  <B24InputMenu v-model="value" clear :items="items" />
</template>
```

### Иконка очистки

Пропс `clear-icon` меняет [иконку](https://bitrix24.github.io/b24icons/icons/) кнопки очистки.

```vue
<script setup lang="ts">
const items = ref([
  'Backlog',
  'Todo',
  'In Progress',
  'Done'
])
const value = ref('Backlog')
</script>

<template>
  <B24InputMenu v-model="value" clear clear-icon="RocketIcon" :items="items" />
</template>
```

### Аватар

Пропс `avatar` показывает [Avatar](https://b24-ui.bx-shef.by/raw/docs/components/avatar.md) внутри InputMenu.

```vue
<script setup lang="ts">
const items = ref([
  'Backlog',
  'Todo',
  'In Progress',
  'Done'
])
const value = ref('Backlog')
</script>

<template>
  <B24InputMenu v-model="value" :avatar="{src:'/b24ui/avatar/employee.png',loading:'lazy'}" :items="items" />
</template>
```

### Загрузка

Пропс `loading` показывает иконку загрузки в InputMenu.

```vue
<script setup lang="ts">
const items = ref([
  'Backlog',
  'Todo',
  'In Progress',
  'Done'
])
const value = ref('Backlog')
</script>

<template>
  <B24InputMenu v-model="value" loading :items="items" />
</template>
```

### Отключение

Пропс `disabled` отключает InputMenu.

```vue
<script setup lang="ts">
const items = ref([
  'Backlog',
  'Todo',
  'In Progress',
  'Done'
])
</script>

<template>
  <B24InputMenu disabled placeholder="Выберите статус" :items="items" />
</template>
```

### Без границы

Пропс `noBorder` убирает у InputMenu все границы (кольца).

```vue
<script setup lang="ts">
const items = ref([
  'Backlog',
  'Todo',
  'In Progress',
  'Done'
])
</script>

<template>
  <B24InputMenu no-border highlight placeholder="Выберите статус" :items="items" />
</template>
```

> [!NOTE]
> Пропс `highlight` здесь показывает, что состояния фокуса нет.

### Подчёркивание

Пропс `underline` убирает у InputMenu все границы (кольца), кроме нижней.

```vue
<script setup lang="ts">
const items = ref([
  'Backlog',
  'Todo',
  'In Progress',
  'Done'
])
</script>

<template>
  <B24InputMenu underline highlight placeholder="Выберите статус" :items="items" />
</template>
```

> [!NOTE]
> Пропс `highlight` здесь показывает состояние фокуса.

### Скругление

Пропс `rounded` скругляет InputMenu.

```vue
<script setup lang="ts">
const items = ref([
  'Backlog',
  'Todo',
  'In Progress',
  'Done'
])
</script>

<template>
  <B24InputMenu rounded highlight placeholder="Выберите статус" :items="items" />
</template>
```

> [!NOTE]
> Пропс `highlight` здесь показывает состояние фокуса.

## Примеры

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

Свойство `type` со значением `separator` показывает разделитель между элементами, а со значением `label` — подпись.

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

const items = ref<InputMenuItem[]>([
  [
    {
      type: 'label',
      label: 'Fruits'
    },
    'Apple',
    'Banana',
    {
      type: 'separator'
    },
    'Blueberry',
    'Grapes',
    'Pineapple'
  ],
  [
    {
      type: 'label',
      label: 'Vegetables'
    },
    'Aubergine',
    'Broccoli',
    'Carrot',
    'Courgette',
    'Leek'
  ]
])
const value = ref('Apple')
</script>

<template>
  <B24InputMenu v-model="value" :items="items" />
</template>
```

> [!NOTE]
> Если `label` используется как заголовок группы, передайте массив массивов: тогда при поиске подпись исчезает вместе со своей группой.

### С цветными элементами

Свойство `color` меняет цвет элементов.

```vue [InputMenuItemsColorExample.vue]
<script setup lang="ts">
import type { InputMenuItem } from '@bxshefby/b24ui-nuxt'
import SettingsIcon from '@bitrix24/b24icons-vue/main/SettingsIcon'
import MyPlanIcon from '@bitrix24/b24icons-vue/main/MyPlanIcon'
import Shield2DefendedIcon from '@bitrix24/b24icons-vue/main/Shield2DefendedIcon'

const items = ref([
  {
    label: 'Настройки CRM',
    value: 'settings',
    color: 'air-primary',
    icon: SettingsIcon
  },
  {
    label: 'Реквизиты моей компании',
    value: 'my_company_details',
    color: 'air-primary-success',
    icon: MyPlanIcon
  },
  {
    label: 'В работе',
    value: 'in_progress'
  },
  {
    label: 'Права доступа',
    value: 'access_permissions',
    color: 'air-primary-alert',
    icon: Shield2DefendedIcon
  }
] satisfies InputMenuItem[])

const value = ref(items.value[0])
</script>

<template>
  <B24InputMenu v-model="value" :icon="value?.icon" :items="items" />
</template>
```

### С иконкой в элементах

Свойство `icon` показывает [иконку](https://bitrix24.github.io/b24icons/icons/) внутри элементов.

```vue [InputMenuItemsIconExample.vue]
<script setup lang="ts">
import type { InputMenuItem } from '@bxshefby/b24ui-nuxt'
import SettingsIcon from '@bitrix24/b24icons-vue/main/SettingsIcon'
import MyPlanIcon from '@bitrix24/b24icons-vue/main/MyPlanIcon'
import Shield2DefendedIcon from '@bitrix24/b24icons-vue/main/Shield2DefendedIcon'

const items = ref([
  {
    label: 'Настройки CRM',
    value: 'settings',
    icon: SettingsIcon
  },
  {
    label: 'Реквизиты моей компании',
    value: 'my_company_details',
    icon: MyPlanIcon
  },
  {
    label: 'В работе',
    value: 'in_progress'
  },
  {
    label: 'Права доступа',
    value: 'access_permissions',
    icon: Shield2DefendedIcon
  }
] satisfies InputMenuItem[])

const value = ref(items.value[0])
</script>

<template>
  <B24InputMenu v-model="value" :icon="value?.icon" :items="items" />
</template>
```

> [!TIP]
> Слот `#leading` позволяет показать иконку выбранного элемента.

### С аватаром в элементах

Свойство `avatar` показывает [Avatar](https://b24-ui.bx-shef.by/raw/docs/components/avatar.md) внутри элементов.

```vue [InputMenuItemsAvatarExample.vue]
<script setup lang="ts">
import type { InputMenuItem } from '@bxshefby/b24ui-nuxt'

const items = ref([
  {
    label: 'Ассистент',
    value: 'assistant',
    avatar: {
      src: '/b24ui/avatar/assistant.png',
      alt: 'assistant',
      loading: 'lazy' as const
    }
  },
  {
    label: 'Сотрудник',
    value: 'employee',
    avatar: {
      src: '/b24ui/avatar/employee.png',
      alt: 'employee',
      loading: 'lazy' as const
    }
  }
] satisfies InputMenuItem[])

const value = ref(items.value[0])
</script>

<template>
  <B24InputMenu v-model="value" :avatar="value?.avatar" :items="items" />
</template>
```

> [!TIP]
> Слот `#leading` позволяет показать аватар выбранного элемента.

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

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

```vue [InputMenuItemsChipExample.vue]
<script setup lang="ts">
import type { InputMenuItem, ChipProps } from '@bxshefby/b24ui-nuxt'

const items = ref([
  {
    label: 'Ошибка',
    value: 'bug',
    chip: {
      color: 'air-primary-alert'
    }
  },
  {
    label: 'Функция',
    value: 'feature',
    chip: {
      color: 'air-primary-success'
    }
  },
  {
    label: 'Улучшение',
    value: 'enhancement',
    chip: {
      color: 'air-primary-copilot'
    }
  }
] satisfies InputMenuItem[])

const value = ref(items.value[0])
</script>

<template>
  <B24InputMenu v-model="value" :items="items">
    <template #leading="{ modelValue, b24ui }">
      <B24Chip
        v-if="modelValue"
        v-bind="modelValue.chip"
        inset
        standalone
        :size="(b24ui.itemLeadingChipSize() as ChipProps['size'])"
        :class="b24ui.itemLeadingChip()"
      />
    </template>
  </B24InputMenu>
</template>
```

> [!NOTE]
> В этом примере слот `#leading` показывает выбранный чип.

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

Состоянием открытия управляют пропс `default-open` или директива `v-model:open`.

```vue [InputMenuOpenExample.vue]
<script setup lang="ts">
const open = ref(false)
const items = ref(['Настройки CRM', 'Реквизиты моей компании', 'Права доступа'])
const value = ref('Реквизиты моей компании')

defineShortcuts({
  o: () => open.value = !open.value
})
</script>

<template>
  <B24InputMenu v-model="value" v-model:open="open" :items="items" />
</template>
```

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

### Открытие при фокусе

Пропсы `open-on-focus` и `open-on-click` открывают меню, когда поле получает фокус или по нему щёлкают.

```vue [InputMenuOpenFocusExample.vue]
<script setup lang="ts">
const items = ref(['Настройки CRM', 'Реквизиты моей компании', 'Права доступа'])
const selected = ref('Реквизиты моей компании')
</script>

<template>
  <B24InputMenu
    v-model="selected"
    :items="items"
    open-on-focus
  />
</template>
```

### Управление поисковым запросом

Директива `v-model:search-term` управляет поисковым запросом.

```vue [InputMenuSearchTermExample.vue]
<script setup lang="ts">
const searchTerm = ref('o')
const items = ref(['Настройки CRM', 'Реквизиты моей компании', 'Права доступа'])
const value = ref('Реквизиты моей компании')
</script>

<template>
  <B24InputMenu v-model="value" v-model:search-term="searchTerm" :items="items" />
</template>
```

### С вращающейся иконкой

Пример с вращающейся иконкой, которая показывает состояние открытия InputMenu.

```vue [InputMenuIconExample.vue]
<script setup lang="ts">
const items = ref(['Настройки CRM', 'Реквизиты моей компании', 'Права доступа'])
const value = ref('Реквизиты моей компании')
</script>

<template>
  <B24InputMenu
    v-model="value"
    :items="items"
    :b24ui="{
      trailingIcon: 'group-data-[state=open]:rotate-180 transition-transform duration-200'
    }"
  />
</template>
```

### С плавающей подписью `2.15+`

Слот `#default` позволяет добавить InputMenu плавающую подпись.

```vue [InputMenuFloatingLabelExample.vue]
<script setup lang="ts">
const items = ref([
  'Бэклог',
  'К выполнению',
  'В работе',
  'Готово'
])

const value = ref('')
</script>

<template>
  <B24InputMenu id="status" v-model="value" :items="items" placeholder="" :b24ui="{ base: 'peer' }">
    <label for="status" class="pointer-events-none absolute start-0 -top-[10px] text-label text-(length:--ui-font-size-xs)/(--ui-font-line-height-reset) font-(--ui-font-weight-medium) px-1.5 transition-all peer-focus:-top-[10px] peer-focus:text-label peer-focus:text-(length:--ui-font-size-xs)/(--ui-font-line-height-reset) peer-focus:font-(--ui-font-weight-medium) peer-placeholder-shown:text-(length:--ui-font-size-sm)/(--ui-font-line-height-reset) peer-placeholder-shown:text-legend peer-placeholder-shown:top-[10px] peer-placeholder-shown:font-(--ui-font-weight-normal)">
      <span class="inline-flex bg-(--ui-color-base-white-fixed) px-1">Статус</span>
    </label>
  </B24InputMenu>
</template>
```

### С созданием элемента

Пропс `create-item` позволяет пользователям добавлять собственные значения, которых нет в готовых вариантах.

```vue [InputMenuCreateItemExample.vue]
<script setup lang="ts">
const items = ref(['Настройки CRM', 'Реквизиты моей компании', 'Права доступа'])
const value = ref('Реквизиты моей компании')

function onCreate(item: string) {
  items.value.push(item)

  value.value = item
}
</script>

<template>
  <B24InputMenu
    v-model="value"
    create-item
    :items="items"
    class="w-80"
    @create="onCreate"
  />
</template>
```

> [!NOTE]
> По умолчанию пункт создания показывается, когда совпадений нет. Значение `always` показывает его, даже если есть похожие значения.

> [!TIP]
> See: #emits
> Событие `@create` обрабатывает создание элемента. В обработчик придут событие и элемент.

### С загружаемыми элементами

Элементы можно загружать из API и использовать в InputMenu.

```vue [InputMenuFetchExample.vue]
<script setup lang="ts">
import type { AvatarProps } from '@bxshefby/b24ui-nuxt'
import UserIcon from '@bitrix24/b24icons-vue/common-b24/UserIcon'
import Expand1Icon from '@bitrix24/b24icons-vue/actions/Expand1Icon'

const { data: users, status, execute } = await useLazyFetch('https://jsonplaceholder.typicode.com/users', {
  key: 'typicode-users',
  transform: (data: { id: number, name: string }[]) => {
    return data?.map(user => ({
      label: user.name,
      value: String(user.id),
      avatar: { src: `https://i.pravatar.cc/120?img=${user.id}`, loading: 'lazy' as const }
    }))
  },
  immediate: false
})

function onOpen() {
  if (!users.value?.length) {
    execute()
  }
}
</script>

<template>
  <B24InputMenu
    :items="users"
    :loading="status === 'pending'"
    :icon="UserIcon"
    :trailing-icon="Expand1Icon"
    placeholder="Выберите пользователя"
    @update:open="onOpen"
  >
    <template #leading="{ modelValue, b24ui }">
      <B24Avatar
        v-if="modelValue"
        v-bind="modelValue.avatar"
        :size="(b24ui.leadingAvatarSize() as AvatarProps['size'])"
        :class="b24ui.leadingAvatar()"
      />
    </template>
  </B24InputMenu>
</template>
```

> [!NOTE]
> В примере `useLazyFetch` вызывается с `immediate: false`, поэтому данные запрашиваются только при открытии меню, а лишних запросов к API при загрузке страницы нет.

### С отключённым фильтром

Пропс `ignore-filter` со значением `true` отключает внутренний поиск, и вы можете использовать собственную логику поиска.

```vue [InputMenuIgnoreFilterExample.vue]
<script setup lang="ts">
import type { AvatarProps } from '@bxshefby/b24ui-nuxt'
import { refDebounced } from '@vueuse/core'
import UserIcon from '@bitrix24/b24icons-vue/common-b24/UserIcon'
import Expand1Icon from '@bitrix24/b24icons-vue/actions/Expand1Icon'

const searchTerm = ref('')
const searchTermDebounced = refDebounced(searchTerm, 200)

const { data: users, status, execute } = await useLazyFetch('https://jsonplaceholder.typicode.com/users', {
  key: 'input-menu-users-search',
  query: { q: searchTermDebounced },
  transform: (data: { id: number, name: string }[]) => {
    return data?.map(user => ({
      label: user.name,
      value: String(user.id),
      avatar: { src: `https://i.pravatar.cc/120?img=${user.id}`, loading: 'lazy' as const }
    }))
  },
  immediate: false
})

function onOpen() {
  if (!users.value?.length) {
    execute()
  }
}
</script>

<template>
  <B24InputMenu
    v-model:search-term="searchTerm"
    :items="users"
    :loading="status === 'pending'"
    ignore-filter
    :icon="UserIcon"
    :trailing-icon="Expand1Icon"
    placeholder="Выберите пользователя"
    @update:open="onOpen"
  >
    <template #leading="{ modelValue, b24ui }">
      <B24Avatar
        v-if="modelValue"
        v-bind="modelValue.avatar"
        :size="(b24ui.leadingAvatarSize() as AvatarProps['size'])"
        :class="b24ui.leadingAvatar()"
      />
    </template>
  </B24InputMenu>
</template>
```

> [!NOTE]
> В примере запросы к API откладываются через [`refDebounced`](https://vueuse.org/shared/refDebounced/#refdebounced). Загрузка отложена через `immediate: false`, поэтому запрос не отправляется, пока меню не откроется.

### С полями фильтрации

Пропс `filter-fields` принимает массив полей, по которым выполняется фильтрация. По умолчанию `[labelKey]`.

```vue [InputMenuFilterFieldsExample.vue]
<script setup lang="ts">
import type { AvatarProps } from '@bxshefby/b24ui-nuxt'
import UserIcon from '@bitrix24/b24icons-vue/common-b24/UserIcon'
import Expand1Icon from '@bitrix24/b24icons-vue/actions/Expand1Icon'

const { data: users, status, execute } = await useLazyFetch('https://jsonplaceholder.typicode.com/users', {
  key: 'typicode-users-email',
  transform: (data: { id: number, name: string, email: string }[]) => {
    return data?.map(user => ({
      label: user.name,
      email: user.email,
      value: String(user.id),
      avatar: { src: `https://i.pravatar.cc/120?img=${user.id}`, loading: 'lazy' as const }
    }))
  },
  immediate: false
})

function onOpen() {
  if (!users.value?.length) {
    execute()
  }
}
</script>

<template>
  <B24InputMenu
    :items="users"
    :loading="status === 'pending'"
    :filter-fields="['label', 'email']"
    :icon="UserIcon"
    :trailing-icon="Expand1Icon"
    placeholder="Выберите пользователя"
    class="w-80"
    :b24ui="{ content: 'w-80', viewport: 'w-80' }"
    @update:open="onOpen"
  >
    <template #leading="{ modelValue, b24ui }">
      <B24Avatar
        v-if="modelValue"
        v-bind="modelValue.avatar"
        :size="(b24ui.leadingAvatarSize() as AvatarProps['size'])"
        :class="b24ui.leadingAvatar()"
      />
    </template>

    <template #item-label="{ item }">
      {{ item.label }}

      <span class="text-description">
        {{ item.email }}
      </span>
    </template>
  </B24InputMenu>
</template>
```

> [!NOTE]
> В примере `useLazyFetch` вызывается с `immediate: false`, поэтому данные запрашиваются только при открытии меню, а лишних запросов к API при загрузке страницы нет.

### С виртуализацией

Пропс `virtualize` включает виртуализацию для больших списков: булево значение или объект с параметрами вроде `{ estimateSize: 32, overscan: 12 }`.

> [!WARNING]
> See: https://github.com/unovue/reka-ui/issues/1885
> При включении все группы объединяются в один список из-за ограничения Reka UI.

```vue [InputMenuVirtualizeExample.vue]
<script setup lang="ts">
import type { InputMenuItem } from '@bxshefby/b24ui-nuxt'

const items: InputMenuItem[] = Array(1000).fill(0).map((_, i) => ({
  label: `item-${i}`,
  value: i
}))
</script>

<template>
  <B24InputMenu virtualize :items="items" class="w-48" />
</template>
```

### С бесконечной прокруткой

Композабл [`useInfiniteScroll`](https://vueuse.org/core/useInfiniteScroll/) подгружает данные по мере прокрутки.

```vue [InputMenuInfiniteScrollExample.vue]
<script setup lang="ts">
import { useInfiniteScroll } from '@vueuse/core'

type User = {
  firstName: string
}

type UserResponse = {
  users: User[]
  total: number
  skip: number
  limit: number
}

const skip = ref(0)

const { data, status, execute } = await useLazyFetch('https://dummyjson.com/users?limit=10&select=firstName', {
  key: 'input-menu-users-infinite-scroll',
  query: { skip },
  transform: (data?: UserResponse) => {
    return data?.users.map(user => user.firstName)
  },
  immediate: false
})

const users = ref<string[]>([])

watch(data, () => {
  users.value = [
    ...users.value,
    ...(data.value || [])
  ]
})

function onOpen() {
  if (!users.value?.length) {
    execute()
  }
}

const inputMenu = useTemplateRef('inputMenu')

onMounted(() => {
  useInfiniteScroll(() => inputMenu.value?.viewportRef, () => {
    skip.value += 10
  }, {
    canLoadMore: () => {
      return status.value !== 'pending'
    }
  })
})
</script>

<template>
  <B24InputMenu
    ref="inputMenu"
    placeholder="Выберите пользователя"
    :items="users"
    @update:open="onOpen"
  />
</template>
```

> [!NOTE]
> В примере `useLazyFetch` вызывается с `immediate: false`, поэтому данные загружаются только по мере прокрутки.

### С содержимым на всю ширину

Чтобы содержимое занимало всю ширину своих элементов, добавьте класс `min-w-fit` в слоты `b24ui.content`, `b24ui.item` и `b24ui.viewport`.

```vue [InputMenuContentWidthExample.vue]
<script setup lang="ts">
import UserIcon from '@bitrix24/b24icons-vue/common-b24/UserIcon'
import Expand1Icon from '@bitrix24/b24icons-vue/actions/Expand1Icon'

const { data: users, execute } = await useLazyFetch('https://jsonplaceholder.typicode.com/users', {
  key: 'typicode-users-email',
  transform: (data: { id: number, name: string, email: string }[]) => {
    return data?.map(user => ({
      label: user.name,
      email: user.email,
      value: String(user.id),
      avatar: { src: `https://i.pravatar.cc/120?img=${user.id}`, loading: 'lazy' as const }
    }))
  },
  immediate: false
})

function onOpen() {
  if (!users.value?.length) {
    execute()
  }
}
</script>

<template>
  <B24InputMenu
    :items="users"
    :icon="UserIcon"
    :trailing-icon="Expand1Icon"
    placeholder="Выберите пользователя"
    :b24ui="{ content: 'min-w-fit', viewport: 'min-w-fit', item: 'min-w-fit' }"
    @update:open="onOpen"
  >
    <template #item-label="{ item }">
      {{ item.label }}

      <span class="text-description">
        {{ item.email }}
      </span>
    </template>
  </B24InputMenu>
</template>
```

### Как выбор страны

InputMenu можно использовать как выбор страны с ленивой загрузкой. Страны загружаются только при первом открытии меню.

```vue [InputMenuCountriesExample.vue]
<script setup lang="ts">
import CrmSearchIcon from '@bitrix24/b24icons-vue/crm/CrmSearchIcon'
import EarthIcon from '@bitrix24/b24icons-vue/main/EarthIcon'

const { data: countries, status, execute } = await useLazyFetch<{
  name: string
  code: string
  emoji: string
}[]>('/api/countries.json', {
  key: 'api-countries',
  immediate: false
})

function onOpen() {
  if (!countries.value?.length) {
    execute()
  }
}
</script>

<template>
  <B24InputMenu
    :items="countries"
    :loading="status === 'pending'"
    label-key="name"
    :search-input="{ icon: CrmSearchIcon }"
    placeholder="Выберите страну"
    @update:open="onOpen"
  >
    <template #leading="{ modelValue, b24ui }">
      <span v-if="modelValue" class="size-6.5 text-center">
        {{ modelValue?.emoji }}
      </span>
      <EarthIcon v-else :class="b24ui.leadingIcon()" />
    </template>
    <template #item-leading="{ item }">
      <span class="size-6.5 text-center">
        {{ item.emoji }}
      </span>
    </template>
  </B24InputMenu>
</template>
```

> [!NOTE]
> В примере `useLazyFetch` вызывается с `immediate: false`, поэтому страны загружаются только при первом открытии меню.

## API

### Пропсы

```ts
/**
 * Props for the InputMenu component
 */
interface InputMenuProps {
  /**
   * The element or component this component should render as.
   * @default 'div'
   */
  as?: any;
  id?: string | undefined;
  /**
   * @default 'text'
   */
  type?: "number" | "color" | "search" | "file" | "button" | "checkbox" | "date" | "datetime-local" | "email" | "hidden" | "image" | "month" | "password" | "radio" | "range" | "reset" | "submit" | "tel" | "text" | "time" | "url" | "week" | string & {} | undefined;
  /**
   * The placeholder text when the input is empty.
   */
  placeholder?: string | undefined;
  /**
   * @default 'air-primary'
   */
  color?: "air-primary" | "air-primary-success" | "air-primary-alert" | "air-primary-warning" | "air-primary-copilot";
  /**
   * @default 'md'
   */
  size?: "sm" | "xss" | "xs" | "md" | "lg" | "xl" | undefined;
  /**
   * Removes all borders (rings)
   * @default false
   */
  noBorder?: boolean | undefined;
  /**
   * Removes all borders (rings) except the bottom one
   * @default false
   */
  underline?: boolean | undefined;
  /**
   * Rounds the corners of the input
   * @default false
   */
  rounded?: boolean | undefined;
  required?: boolean | undefined;
  autofocus?: boolean | undefined;
  /**
   * @default 0
   */
  autofocusDelay?: number | 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 an item is selected.
   * @default icons.check
   */
  selectedIcon?: (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 to delete a tag.
   * Works only when `multiple` is `true`.
   * @default icons.close
   */
  deleteIcon?: (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;
  /**
   * Display a clear button to reset the model value.
   * Can be an object to pass additional props to the Button.
   * @default false
   */
  clear?: C & false | C & true | C & Partial<Omit<ButtonProps, LinkPropsKeys>> | undefined;
  /**
   * The icon displayed in the clear button.
   * @default icons.close
   */
  clearIcon?: (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 content of the menu.
   * @default { side: 'bottom', sideOffset: 8, collisionPadding: 8, position: 'popper' }
   */
  content?: Omit<ComboboxContentProps, "as" | "asChild" | "forceMount"> & Partial<EmitsToProps<DismissableLayerEmits>> | undefined;
  /**
   * Display an arrow alongside the menu.
   * @default false
   */
  arrow?: boolean | Omit<ComboboxArrowProps, "as" | "asChild"> | undefined;
  /**
   * Render the menu in a portal.
   * @default true
   */
  portal?: string | false | true | HTMLElement | undefined;
  /**
   * Enable virtualization for large lists.
   * Note: when enabled, all groups are flattened into a single list due to a limitation of Reka UI (https://github.com/unovue/reka-ui/issues/1885).
   * @default false
   */
  virtualize?: boolean | { overscan?: number | undefined; estimateSize?: number | ((index: number) => number) | undefined; } | undefined;
  /**
   * When `items` is an array of objects, select the field to use as the value instead of the object itself.
   * @default undefined
   */
  valueKey?: VK | undefined;
  /**
   * When `items` is an array of objects, select the field to use as the label.
   * @default 'label'
   */
  labelKey?: keyof Extract<NestedItem<T>, object> & string | DotPathKeys<Extract<NestedItem<T>, object>> | undefined;
  /**
   * When `items` is an array of objects, select the field to use as the description.
   * @default 'description'
   */
  descriptionKey?: keyof Extract<NestedItem<T>, object> & string | DotPathKeys<Extract<NestedItem<T>, object>> | undefined;
  items?: T | undefined;
  /**
   * The value of the InputMenu when initially rendered. Use when you do not need to control the state of the InputMenu.
   */
  defaultValue?: _Number<_Optional<_Nullable<GetModelValue<T, VK, M, ExcludeItem>, Mod>, Mod>, Mod> | IsClearUsed<M, C> | undefined;
  /**
   * The controlled value of the InputMenu. Can be binded-with with `v-model`.
   */
  modelValue?: _Number<_Optional<_Nullable<GetModelValue<T, VK, M, ExcludeItem>, Mod>, Mod>, Mod> | IsClearUsed<M, C> | undefined;
  modelModifiers?: Mod | undefined;
  /**
   * Whether multiple options can be selected or not.
   */
  multiple?: M | undefined;
  tag?: string | undefined;
  /**
   * @default 'air-primary'
   */
  tagColor?: "air-primary" | "air-primary-success" | "air-primary-alert" | "air-primary-warning" | "air-primary-copilot" | "air-secondary" | "air-secondary-alert" | "air-secondary-accent" | "air-secondary-accent-1" | "air-secondary-accent-2" | "air-tertiary" | "air-selection";
  /**
   * Highlight the ring color like a focus state.
   */
  highlight?: boolean | undefined;
  /**
   * Keep the mobile text size on all breakpoints. (Left for backward compatibility.)
   */
  fixed?: boolean | undefined;
  /**
   * The behavior of the InputMenu.
   * - `combobox`: select one (or many) items from a list of suggestions.
   * - `autocomplete`: free-form text input with optional suggestions. The `modelValue`
   *   becomes the input text (`string`) instead of a selected item.
   * @default 'combobox'
   */
  mode?: "autocomplete" | "combobox" | undefined;
  /**
   * Determines if custom user input that does not exist in options can be added.
   * @default false
   */
  createItem?: boolean | "always" | { position?: "top" | "bottom" | undefined; when?: "empty" | "always" | undefined; } | undefined;
  /**
   * Fields to filter items by.
   * @default [labelKey]
   */
  filterFields?: string[] | undefined;
  /**
   * When `true`, disable the default filters, useful for custom filtering (useAsyncData, useFetch, etc.).
   * @default false
   */
  ignoreFilter?: boolean | undefined;
  b24ui?: { root?: SlotClass; base?: SlotClass; leading?: SlotClass; leadingIcon?: SlotClass; leadingAvatar?: SlotClass; leadingAvatarSize?: SlotClass; trailing?: SlotClass; trailingIcon?: SlotClass; tag?: SlotClass; trailingClear?: SlotClass; content?: SlotClass; viewport?: SlotClass; arrow?: SlotClass; group?: SlotClass; empty?: SlotClass; label?: SlotClass; separator?: SlotClass; item?: SlotClass; itemLeadingIcon?: SlotClass; itemLeadingAvatar?: SlotClass; itemLeadingAvatarSize?: SlotClass; itemLeadingChip?: SlotClass; itemLeadingChipSize?: SlotClass; itemTrailing?: SlotClass; itemTrailingIcon?: SlotClass; itemWrapper?: SlotClass; itemLabel?: SlotClass; itemDescription?: SlotClass; tagsItem?: SlotClass; tagsItemText?: SlotClass; tagsItemDelete?: SlotClass; tagsItemDeleteIcon?: SlotClass; tagsInput?: SlotClass; } | undefined;
  /**
   * When `true`, prevents the user from interacting with listbox
   */
  disabled?: boolean | undefined;
  /**
   * The controlled open state of the Combobox. Can be binded with `v-model:open`.
   */
  open?: boolean | undefined;
  /**
   * The open state of the combobox when it is initially rendered. <br> Use when you do not need to control its open state.
   */
  defaultOpen?: boolean | undefined;
  /**
   * The name of the field. Submitted with its owning form as part of a name/value pair.
   */
  name?: string | undefined;
  /**
   * Whether to reset the searchTerm when the Combobox input blurred
   * @default true
   */
  resetSearchTermOnBlur?: boolean | undefined;
  /**
   * Whether to reset the searchTerm when the Combobox value is selected
   * @default true
   */
  resetSearchTermOnSelect?: boolean | undefined;
  /**
   * When `true` the `modelValue` will be reset to `null` (or `[]` if `multiple`)
   * @default true
   */
  resetModelValueOnClear?: boolean | undefined;
  /**
   * When `true`, hover over item will trigger highlight
   */
  highlightOnHover?: boolean | undefined;
  /**
   * When `true`, keyboard navigation will loop from last item to first, and vice versa.
   */
  loop?: boolean | undefined;
  /**
   * Whether to open the combobox when the input is clicked
   * @default `false`
   */
  openOnClick?: boolean | undefined;
  /**
   * Whether to open the combobox when the input is focused
   * @default `false`
   */
  openOnFocus?: boolean | undefined;
  /**
   * Use this to compare objects by a particular field, or pass your own comparison function for complete control over how objects are compared.
   */
  by?: string | (a: T, b: T): boolean | undefined;
  /**
   * Display an icon on the left side.
   */
  icon?: (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;
  /**
   * Display an avatar on the left side.
   */
  avatar?: AvatarProps | undefined;
  /**
   * When `true`, the loading icon will be displayed.
   */
  loading?: boolean | undefined;
  /**
   * When `true`, the icon will be displayed on the right side.
   */
  trailing?: boolean | undefined;
  /**
   * @deprecated Use `enterkeyhint` instead.
   */
  enterKeyHint?: "search" | "enter" | "done" | "go" | "next" | "previous" | "send" | undefined;
  form?: string | undefined;
  formaction?: string | undefined;
  formenctype?: string | undefined;
  formmethod?: string | undefined;
  formnovalidate?: false | true | "true" | "false" | undefined;
  formtarget?: string | undefined;
  list?: string | undefined;
  readonly?: false | true | "true" | "false" | undefined;
  autocomplete?: string & {} | "on" | "off" | undefined;
  /**
   * @default ''
   */
  searchTerm?: string | undefined;
}
```

> [!NOTE]
> See: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#attributes
> Компонент поддерживает и все нативные HTML-атрибуты `<input>`.

### Слоты

```ts
/**
 * Slots for the InputMenu component
 */
interface InputMenuSlots {
  leading(): any;
  default(): any;
  trailing(): any;
  empty(): any;
  item(): any;
  item-leading(): any;
  item-label(): any;
  item-description(): any;
  item-trailing(): any;
  tags-item-text(): any;
  tags-item-delete(): any;
  content-top(): any;
  content-bottom(): any;
  create-item-label(): any;
}
```

### События

```ts
/**
 * Emitted events for the InputMenu component
 */
interface InputMenuEmits {
  update:open: (payload: [value: boolean]) => void;
  change: (payload: [event: Event]) => void;
  blur: (payload: [event: FocusEvent]) => void;
  focus: (payload: [event: FocusEvent]) => void;
  create: (payload: [item: string]) => void;
  clear: (payload: []) => void;
  highlight: (payload: [payload: { ref: HTMLElement; value: _Number<_Optional<_Nullable<GetModelValue<T, VK, M, ExcludeItem>, Mod>, Mod>, Mod> | IsClearUsed<M, C>; } | undefined]) => void;
  remove-tag: (payload: [item: _Number<_Optional<_Nullable<GetModelValue<T, VK, M, ExcludeItem>, Mod>, Mod>, Mod> | IsClearUsed<M, C>]) => void;
  update:modelValue: (payload: [value: _Number<_Optional<_Nullable<GetModelValue<T, VK, M, ExcludeItem>, Mod>, Mod>, Mod> | IsClearUsed<M, C>]) => void;
  update:searchTerm: (payload: [value: string]) => void;
}
```

### Доступ через ref

При обращении к компоненту через ref в шаблоне доступно:

| Имя | Тип |
| --- | --- |
| `inputRef` | `Ref<HTMLInputElement \| null>` |
| `viewportRef` | `Ref<HTMLDivElement \| null>` |

## Тема

```ts [app.config.ts]
export default defineAppConfig({
  b24ui: {
    inputMenu: {
      slots: {
        root: 'isolate relative inline-flex items-center',
        base: 'w-full py-0 border-0 focus:outline-none disabled:cursor-not-allowed disabled:pointer-events-auto disabled:select-none disabled:opacity-30 disabled:resize-none appearance-none transition-colors duration-300 ease-linear text-(--ui-color-base-1) style-blurred-bg-input hover:text-(--ui-color-base-1) focus:text-(--ui-color-base-1) active:text-(--ui-color-base-1) placeholder:text-(--ui-color-design-plain-na-content-secondary) font-[family-name:var(--ui-font-family-primary)] font-(--ui-font-weight-regular) align-middle',
        leading: 'absolute inset-y-0 start-0 flex items-center',
        leadingIcon: 'shrink-0 text-(--b24ui-icon-color)',
        leadingAvatar: 'shrink-0',
        leadingAvatarSize: '',
        trailing: 'group absolute inset-y-0 end-0 flex items-center disabled:cursor-not-allowed disabled:opacity-30 focus:outline-none',
        trailingIcon: 'shrink-0 text-(--b24ui-icon-color)',
        tag: 'pointer-events-none select-none absolute z-10 -top-[7px] right-[14px] flex flex-col justify-center items-center',
        trailingClear: 'p-0',
        content: 'base-mode flex flex-col max-h-[min(var(--max-height-popup-list),var(--reka-combobox-content-available-height,100vh))] bg-(--ui-color-bg-content-primary) shadow-(--popup-window-box-shadow) rounded-(--ui-border-radius-xl) will-change-[opacity] motion-safe:data-[state=open]:animate-[scale-in_100ms_var(--ease-out)] motion-safe:data-[state=closed]:animate-[scale-out_100ms_var(--ease-out)] origin-(--reka-combobox-content-transform-origin) font-[family-name:var(--ui-font-family-primary)] relative isolate px-0 py-(--menu-popup-padding) pointer-events-auto',
        viewport: 'relative scroll-py-1 w-60 min-w-(--reka-combobox-trigger-width) flex-1 overflow-x-hidden overflow-y-auto scrollbar-thin',
        arrow: 'fill-(--ui-color-bg-content-primary)',
        group: 'grid',
        empty: 'h-(--popup-window-delimiter-section-height) py-2 select-none outline-none whitespace-nowrap text-center text-(length:--ui-size-sm)/(--ui-font-line-height-lg) text-legend font-(--ui-font-weight-normal)',
        label: '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-[10px] after:block after:flex-1 after:min-w-[15px] after:h-px after:bg-(--ui-color-divider-vibrant-default)',
        separator: 'my-2 mx-4.5 h-[1px] bg-(--ui-color-divider-vibrant-default)',
        item: 'group w-full min-w-[195px] h-[36px] px-4.5 mt-(--menu-item-block-stack-space) relative flex flex-row rtl:flex-row-reverse items-center select-none outline-none whitespace-nowrap cursor-pointer data-disabled:cursor-not-allowed data-disabled:opacity-30 data-disabled:select-none text-start text-(length:--ui-font-size-md) text-legend hover:text-label data-highlighted:not-data-disabled:text-label data-[state=open]:text-label data-[state=checked]:text-label 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]:bg-(--ui-color-base-black-fixed)/6 dark:data-[state=open]:bg-(--ui-color-base-black-fixed) transition-colors',
        itemLeadingIcon: 'size-[25px] shrink-0 text-(--ui-color-base-5) group-data-highlighted:not-data-disabled:text-(--ui-color-accent-main-primary) group-data-[state=open]:text-(--ui-color-accent-main-primary) group-data-[state=checked]:text-(--ui-color-accent-main-primary)',
        itemLeadingAvatar: 'shrink-0 size-[16px]',
        itemLeadingAvatarSize: '2xs',
        itemLeadingChip: 'shrink-0 size-[16px]',
        itemLeadingChipSize: 'sm',
        itemTrailing: 'ml-auto rtl:ml-0 rtl:mr-auto inline-flex gap-1.5 items-center',
        itemTrailingIcon: 'shrink-0 size-[24px] text-(--ui-color-accent-main-primary)',
        itemWrapper: 'flex-1 flex flex-col min-w-0',
        itemLabel: 'truncate ms-[2px] -mt-px',
        itemDescription: 'truncate -mt-[6px] text-description text-(length:--ui-font-size-sm)',
        tagsItem: 'ps-[13px] pe-[6px] rounded-(--ui-border-radius-xs) h-(--main-ui-square-item-height) leading-(--main-ui-square-item-height) font-[family-name:var(--ui-font-family-primary)] font-(--ui-font-weight-regular) inline-flex items-center gap-1 min-w-0 max-w-[70%] data-disabled:cursor-not-allowed data-disabled:opacity-30 data-disabled:select-none text-(--ui-color-design-tinted-content) bg-(--ui-color-design-tinted-bg-alt)',
        tagsItemText: 'truncate min-w-0',
        tagsItemDelete: 'cursor-pointer shrink-0 inline-flex items-center disabled:cursor-not-allowed disabled:pointer-events-auto text-(--b24ui-icon-color-secondary) hover:text-(--b24ui-icon-color-secondary-hover) transition-none',
        tagsItemDeleteIcon: '',
        tagsInput: ''
      },
      variants: {
        fieldGroup: {
          horizontal: {
            root: 'group leading-none has-focus-visible:z-[1]'
          },
          vertical: {
            root: 'group has-focus-visible:z-[1]'
          }
        },
        noSplit: {
          false: "group-not-only:not-first:after:content-[''] group-not-only:not-first:after:absolute group-not-only:not-first:after:top-[7px] group-not-only:not-first:after:bottom-[6px] group-not-only:not-first:after:left-0 group-not-only:not-first:after:w-px group-not-only:not-first:after:bg-current/30"
        },
        size: {
          xss: {
            base: '[--main-ui-square-item-height:12px] h-[20px] gap-1 text-(length:--ui-font-size-4xs)/[normal]',
            leading: 'px-1',
            trailing: 'px-1',
            leadingIcon: 'size-[12px]',
            leadingAvatarSize: '3xs',
            trailingIcon: 'size-[12px]',
            itemLeadingAvatar: 'size-[12px]',
            itemLeadingAvatarSize: '3xs',
            tagsInput: 'text-(length:--ui-font-size-4xs)/[normal]',
            tagsItem: 'text-(length:--ui-font-size-5xs)/(--main-ui-square-item-height) gap-0.5',
            tagsItemDeleteIcon: 'size-[10px]'
          },
          xs: {
            base: '[--main-ui-square-item-height:16px] h-[24px] gap-1 text-(length:--ui-font-size-4xs)/[normal]',
            leading: 'px-1',
            trailing: 'px-1',
            leadingIcon: 'size-[14px]',
            leadingAvatarSize: '3xs',
            trailingIcon: 'size-[14px]',
            itemLeadingAvatar: 'size-[14px]',
            itemLeadingAvatarSize: '3xs',
            tagsInput: 'text-(length:--ui-font-size-xs)/[normal]',
            tagsItem: 'text-(length:--ui-font-size-5xs)/(--main-ui-square-item-height) gap-0.5',
            tagsItemDeleteIcon: 'size-[10px]'
          },
          sm: {
            base: '[--main-ui-square-item-height:20px] h-[28px] gap-1.5 text-(length:--ui-font-size-xs)/[normal]',
            leading: 'px-1.5',
            trailing: 'px-1.5',
            leadingIcon: 'size-[16px]',
            leadingAvatar: 'size-[16px]',
            leadingAvatarSize: '2xs',
            trailingIcon: 'size-[16px]',
            itemLeadingAvatar: 'size-[16px]',
            itemLeadingAvatarSize: '2xs',
            tagsInput: 'text-(length:--ui-font-size-sm)/[normal]',
            tagsItem: 'text-(length:--ui-font-size-5xs)/(--main-ui-square-item-height) gap-0.5',
            tagsItemDeleteIcon: 'size-[12px]'
          },
          md: {
            base: '[--main-ui-square-item-height:24px] h-[34px] gap-1.5 text-(length:--ui-font-size-lg)/[normal]',
            leading: 'px-2',
            trailing: 'px-2',
            leadingIcon: 'size-4.5',
            leadingAvatarSize: '2xs',
            trailingIcon: 'size-4.5',
            itemLeadingAvatarSize: '2xs',
            tagsInput: 'text-(length:--ui-font-size-lg)/[normal]',
            tagsItem: 'text-(length:--ui-font-size-sm)/(--main-ui-square-item-height) gap-[4px]',
            tagsItemDeleteIcon: 'size-4.5'
          },
          lg: {
            base: '[--main-ui-square-item-height:28px] h-[38px] gap-2 text-(length:--ui-font-size-lg)/[normal]',
            leading: 'px-2',
            trailing: 'px-2',
            leadingIcon: 'size-[22px]',
            leadingAvatarSize: '2xs',
            trailingIcon: 'size-[22px]',
            itemLeadingAvatarSize: '2xs',
            tagsInput: 'text-(length:--ui-font-size-lg)/[normal]',
            tagsItem: 'text-(length:--ui-font-size-md)/(--main-ui-square-item-height) gap-1',
            tagsItemDeleteIcon: 'size-[22px]'
          },
          xl: {
            base: '[--main-ui-square-item-height:32px] h-[46px] gap-2 text-(length:--ui-font-size-2xl)/[normal]',
            leading: 'px-2',
            trailing: 'px-2',
            leadingIcon: 'size-[22px]',
            leadingAvatarSize: '2xs',
            trailingIcon: 'size-[22px]',
            itemLeadingAvatarSize: '2xs',
            tagsInput: 'text-(length:--ui-font-size-2xl)/[normal]',
            tagsItem: 'text-(length:--ui-font-size-xl)/(--main-ui-square-item-height) gap-1',
            tagsItemDeleteIcon: 'size-[22px]'
          }
        },
        color: {
          'air-primary': {
            base: 'style-filled'
          },
          'air-primary-success': {
            base: 'style-filled-success'
          },
          'air-primary-alert': {
            base: 'style-filled-alert'
          },
          'air-primary-copilot': {
            base: 'style-filled-copilot'
          },
          'air-primary-warning': {
            base: 'style-filled-warning'
          },
          default: {
            base: 'style-old-default'
          },
          danger: {
            base: 'style-old-danger'
          },
          success: {
            base: 'style-old-success'
          },
          warning: {
            base: 'style-old-warning'
          },
          primary: {
            base: 'style-old-primary'
          },
          secondary: {
            base: 'style-old-secondary'
          },
          collab: {
            base: 'style-old-collab'
          },
          ai: {
            base: 'style-old-ai'
          }
        },
        rounded: {
          true: 'rounded-(--ui-border-radius-3xl)',
          false: 'rounded-(--ui-border-radius-sm)'
        },
        noPadding: {
          true: {
            base: 'px-0'
          }
        },
        noBorder: {
          true: 'ring-0 focus-visible:ring-0 style-transparent-bg'
        },
        underline: {
          true: 'rounded-none ring-0 focus-visible:ring-0 style-transparent-bg border-b-1 border-b-(--ui-color-design-outline-stroke)'
        },
        leading: {
          true: ''
        },
        trailing: {
          true: ''
        },
        loading: {
          true: ''
        },
        highlight: {
          true: 'ring ring-inset ring-(--b24ui-border-color)'
        },
        fixed: {
          false: ''
        },
        type: {
          file: 'file:me-1.5 file:text-(--ui-color-design-plain-na-content-secondary) file:outline-none'
        },
        virtualize: {
          true: {
            viewport: 'p-1 isolate'
          },
          false: {
            viewport: ''
          }
        },
        addNew: {
          true: {
            group: '',
            item: 'text-legend data-highlighted:not-data-disabled:text-label data-[state=checked]:text-label',
            itemLabel: 'flex flex-row flex-nowrap items-center justify-start gap-2',
            itemLeadingIcon: 'size-[20px] rounded-full text-(--ui-color-base-white-fixed) bg-(--ui-color-design-selection-content-icon-secondary) group-data-highlighted:not-data-disabled:text-(--ui-color-base-white-fixed) group-data-highlighted:not-data-disabled:bg-(--ui-color-design-selection-content-icon) group-data-[state=checked]:text-(--ui-color-base-white-fixed) group-data-[state=checked]:bg-(--ui-color-design-selection-content-icon)'
          }
        },
        multiple: {
          true: {
            root: 'flex-wrap',
            base: 'py-[6px] ps-[6px] pe-[39px]',
            tagsInput: 'flex-1 border-0 bg-transparent ps-[6px] pe-[0px] py-0 placeholder:text-(--ui-color-design-plain-na-content-secondary) focus:outline-none disabled:cursor-not-allowed disabled:pointer-events-auto disabled:select-none disabled:opacity-30 focus:ring-0 focus-visible:ring-0'
          },
          false: {
            base: 'px-3 placeholder:text-(--ui-color-design-plain-na-content-secondary) focus:outline-none disabled:cursor-not-allowed disabled:pointer-events-auto disabled:select-none disabled:opacity-30'
          }
        },
        colorItem: {
          'air-primary': {
            item: 'style-filled'
          },
          'air-primary-success': {
            item: 'style-filled-success'
          },
          'air-primary-alert': {
            item: 'style-filled-alert'
          },
          'air-primary-copilot': {
            item: 'style-filled-copilot'
          },
          'air-primary-warning': {
            item: 'style-filled-warning'
          },
          default: {
            item: 'style-old-default'
          },
          danger: {
            item: 'style-old-danger'
          },
          success: {
            item: 'style-old-success'
          },
          warning: {
            item: 'style-old-warning'
          },
          primary: {
            item: 'style-old-primary'
          },
          secondary: {
            item: 'style-old-secondary'
          },
          collab: {
            item: 'style-old-collab'
          },
          ai: {
            item: 'style-old-ai'
          }
        }
      },
      compoundVariants: [
        {
          multiple: false,
          fieldGroup: 'horizontal',
          class: {
            base: 'focus-visible:outline-none ring ring-inset ring-1 focus-visible:ring-2 group-not-only:group-first:rounded-e-3xl group-not-only:group-last:rounded-s-none group-not-last:group-not-first:rounded-none group-not-only:group-first:rounded-e-none group-not-only:group-last:rounded-s-none group-not-last:group-not-first:rounded-none group-not-only:group-first:border-e-0 group-not-only:group-not-first:border-s-0'
          }
        },
        {
          multiple: false,
          fieldGroup: 'vertical',
          class: {
            base: 'focus-visible:outline-none ring ring-inset ring-1 focus-visible:ring-2 group-not-only:group-first:rounded-b-none group-not-only:group-last:rounded-t-none group-not-last:group-not-first:rounded-none'
          }
        },
        {
          multiple: true,
          fieldGroup: 'horizontal',
          class: {
            base: 'focus-visible:outline-none ring ring-inset ring-0 focus-visible:ring-2 group-[.is-field-group]/items:not-only:first:rounded-e-none group-[.is-field-group]/items:not-only:last:rounded-s-none group-[.is-field-group]/items:not-last:not-first:rounded-none group-[.is-field-group]/items:not-only:first:border-e-0 group-[.is-field-group]/items:not-only:not-first:border-s-0 focus-visible:z-[1]'
          }
        },
        {
          multiple: true,
          fieldGroup: 'vertical',
          class: {
            base: 'focus-visible:outline-none ring ring-inset ring-0 focus-visible:ring-2 not-only:first:rounded-b-none not-only:last:rounded-t-none not-last:not-first:rounded-none focus-visible:z-[1]'
          }
        },
        {
          colorItem: [
            'air-primary',
            'air-primary-success',
            'air-primary-alert',
            'air-primary-copilot',
            'air-primary-warning'
          ],
          active: false,
          class: {
            item: 'text-(--b24ui-background) data-highlighted:text-(--b24ui-background-hover) data-[state=open]:text-(--b24ui-background-hover)',
            itemLeadingIcon: 'text-(--b24ui-background) group-data-highlighted:text-(--b24ui-background-hover) group-data-[state=open]:text-(--b24ui-background-hover)'
          }
        },
        {
          colorItem: [
            'air-primary',
            'air-primary-success',
            'air-primary-alert',
            'air-primary-copilot',
            'air-primary-warning'
          ],
          active: true,
          class: {
            item: 'text-(--b24ui-background-active)',
            itemLeadingIcon: 'text-(--b24ui-background-active) group-data-[state=open]:text-(--b24ui-background-active)'
          }
        },
        {
          colorItem: 'default',
          active: false,
          class: ''
        },
        {
          colorItem: 'default',
          active: true,
          class: ''
        },
        {
          colorItem: [
            'danger',
            'success',
            'warning',
            'primary',
            'secondary',
            'collab',
            'ai'
          ],
          active: false,
          class: {
            item: 'text-(--b24ui-background-active) data-highlighted:text-(--b24ui-background-hover) data-[state=open]:text-(--b24ui-background-hover)',
            itemLeadingIcon: 'text-(--b24ui-icon) group-data-highlighted:text-(--b24ui-icon) group-data-[state=open]:text-(--b24ui-icon)'
          }
        },
        {
          colorItem: [
            'danger',
            'success',
            'warning',
            'primary',
            'secondary',
            'collab',
            'ai'
          ],
          active: true,
          class: {
            item: 'text-(--b24ui-background-active)',
            itemLeadingIcon: 'text-(--b24ui-background-active) group-data-[state=open]:text-(--b24ui-background-active)'
          }
        },
        {
          size: 'xss',
          multiple: true,
          class: {
            base: 'min-h-[20px] h-auto py-[2px] ps-[4px]'
          }
        },
        {
          size: 'xs',
          multiple: true,
          class: {
            base: 'min-h-[24px] h-auto py-[2px] ps-[4px]'
          }
        },
        {
          size: 'sm',
          multiple: true,
          class: {
            base: 'min-h-[28px] h-auto py-[4px] ps-[4px]'
          }
        },
        {
          size: 'md',
          multiple: true,
          class: {
            base: 'min-h-[34px] h-auto py-[4px] ps-[4px]'
          }
        },
        {
          size: 'lg',
          multiple: true,
          class: {
            base: 'min-h-[38px] h-auto py-[4px] ps-[4px]'
          }
        },
        {
          size: 'xl',
          multiple: true,
          class: {
            base: 'min-h-[46px] h-auto'
          }
        },
        {
          highlight: false,
          noBorder: false,
          underline: false,
          class: {
            base: 'ring ring-inset ring-(--ui-color-design-outline-stroke) focus-visible:ring-1 focus-visible:ring-inset focus-visible:ring-(--b24ui-border-color) hover:not-disabled:not-data-disabled:ring-1 hover:not-disabled:not-data-disabled:ring-inset hover:not-disabled:not-data-disabled:ring-(--b24ui-border-color) data-[state=open]:ring-1 data-[state=open]:ring-inset data-[state=open]:ring-(--b24ui-border-color)'
          }
        },
        {
          highlight: true,
          noBorder: false,
          underline: false,
          class: {
            base: 'ring ring-inset ring-(--b24ui-border-color) focus-visible:ring-1 focus-visible:ring-inset focus-visible:ring-(--b24ui-border-color) hover:ring-1 hover:ring-inset hover:ring-(--b24ui-border-color) data-[state=open]:ring-1 data-[state=open]:ring-inset data-[state=open]:ring-(--b24ui-border-color)'
          }
        },
        {
          noBorder: false,
          underline: true,
          class: {
            base: 'focus-visible:border-(--b24ui-border-color) hover:not-disabled:not-data-disabled:border-(--b24ui-border-color) data-[state=open]:border-(--b24ui-border-color)'
          }
        },
        {
          highlight: true,
          noBorder: false,
          underline: true,
          class: {
            base: 'ring-0 border-b-(--b24ui-border-color)'
          }
        },
        {
          highlight: true,
          noBorder: true,
          underline: false,
          class: {
            base: 'ring-0'
          }
        },
        {
          type: 'file',
          size: 'xss',
          class: 'py-[2px]'
        },
        {
          type: 'file',
          size: 'xs',
          class: 'py-[4px]'
        },
        {
          type: 'file',
          size: 'sm',
          class: 'py-[5px]'
        },
        {
          type: 'file',
          size: 'md',
          class: 'py-[7px]'
        },
        {
          type: 'file',
          size: 'lg',
          class: 'py-[9px]'
        },
        {
          type: 'file',
          size: 'xl',
          class: 'py-[11px]'
        },
        {
          leading: true,
          noPadding: false,
          size: 'xss',
          class: 'ps-[20px]'
        },
        {
          leading: true,
          noPadding: false,
          size: 'xs',
          class: 'ps-[22px]'
        },
        {
          leading: true,
          noPadding: false,
          size: 'sm',
          class: 'ps-[28px]'
        },
        {
          leading: true,
          noPadding: false,
          size: 'md',
          class: 'ps-[32px]'
        },
        {
          leading: true,
          noPadding: false,
          size: 'lg',
          class: 'ps-[32px]'
        },
        {
          leading: true,
          noPadding: false,
          size: 'xl',
          class: 'ps-[32px]'
        },
        {
          trailing: true,
          noPadding: false,
          size: 'xss',
          class: 'pe-[20px]'
        },
        {
          trailing: true,
          noPadding: false,
          size: 'xs',
          class: 'pe-[22px]'
        },
        {
          trailing: true,
          noPadding: false,
          size: 'sm',
          class: 'pe-[28px]'
        },
        {
          trailing: true,
          noPadding: false,
          size: 'md',
          class: 'pe-[34px]'
        },
        {
          trailing: true,
          noPadding: false,
          size: 'lg',
          class: 'pe-[38px]'
        },
        {
          trailing: true,
          noPadding: false,
          size: 'xl',
          class: 'pe-[38px]'
        },
        {
          loading: true,
          leading: true,
          class: {
            leadingIcon: 'size-[21px]'
          }
        },
        {
          loading: true,
          leading: false,
          trailing: true,
          class: {
            trailingIcon: 'size-[21px]'
          }
        },
        {
          loading: true,
          leading: true,
          noPadding: true,
          class: {
            base: 'ps-[34px]'
          }
        },
        {
          loading: true,
          leading: false,
          trailing: true,
          noPadding: true,
          class: {
            base: 'pe-[34px]'
          }
        },
        {
          fieldGroup: [
            'horizontal',
            'vertical'
          ],
          size: [
            'xl',
            'lg',
            'md'
          ],
          rounded: false,
          class: 'rounded-(--ui-border-radius-md)'
        },
        {
          fieldGroup: [
            'horizontal',
            'vertical'
          ],
          size: 'sm',
          rounded: false,
          class: 'rounded-(--ui-border-radius-sm)'
        },
        {
          fieldGroup: [
            'horizontal',
            'vertical'
          ],
          size: 'xs',
          rounded: false,
          class: 'rounded-(--ui-border-radius-xs)'
        },
        {
          fieldGroup: [
            'horizontal',
            'vertical'
          ],
          size: 'xss',
          rounded: false,
          class: 'rounded-[5px]'
        },
        {
          fixed: false,
          size: 'xss',
          class: 'md:text-(length:--ui-font-size-4xs)/[normal]'
        },
        {
          fixed: false,
          size: 'xs',
          class: 'md:text-(length:--ui-font-size-xs)/[normal]'
        },
        {
          fixed: false,
          size: 'sm',
          class: 'md:text-(length:--ui-font-size-sm)/[normal]'
        },
        {
          fixed: false,
          size: 'md',
          class: 'md:text-(length:--ui-font-size-lg)/[normal]'
        },
        {
          fixed: false,
          size: 'lg',
          class: 'md:text-(length:--ui-font-size-lg)/[normal]'
        }
      ],
      defaultVariants: {
        color: 'air-primary',
        size: 'md'
      }
    }
  }
})
```

## Sitemap

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