@primevue/mcp 4.5.5 → 5.0.0-rc.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (173) hide show
  1. package/LICENSE.md +45 -21
  2. package/README.md +48 -250
  3. package/data/components.json +47269 -0
  4. package/data/llms/components/accordion.md +629 -0
  5. package/data/llms/components/animateonscroll.md +165 -0
  6. package/data/llms/components/autocomplete.md +995 -0
  7. package/data/llms/components/avatar.md +264 -0
  8. package/data/llms/components/badge.md +200 -0
  9. package/data/llms/components/blockui.md +99 -0
  10. package/data/llms/components/breadcrumb.md +269 -0
  11. package/data/llms/components/button.md +902 -0
  12. package/data/llms/components/card.md +209 -0
  13. package/data/llms/components/carousel.md +506 -0
  14. package/data/llms/components/cascadeselect.md +1207 -0
  15. package/data/llms/components/chart.md +1022 -0
  16. package/data/llms/components/checkbox.md +401 -0
  17. package/data/llms/components/chip.md +206 -0
  18. package/data/llms/components/colorpicker.md +213 -0
  19. package/data/llms/components/commandmenu.md +660 -0
  20. package/data/llms/components/compare.md +407 -0
  21. package/data/llms/components/confirmdialog.md +343 -0
  22. package/data/llms/components/confirmpopup.md +252 -0
  23. package/data/llms/components/contextmenu.md +522 -0
  24. package/data/llms/components/datatable.md +5266 -0
  25. package/data/llms/components/dataview.md +569 -0
  26. package/data/llms/components/datepicker.md +964 -0
  27. package/data/llms/components/deferredcontent.md +96 -0
  28. package/data/llms/components/dialog.md +702 -0
  29. package/data/llms/components/divider.md +152 -0
  30. package/data/llms/components/dock.md +488 -0
  31. package/data/llms/components/drawer.md +469 -0
  32. package/data/llms/components/dynamicdialog.md +214 -0
  33. package/data/llms/components/editor.md +205 -0
  34. package/data/llms/components/fieldset.md +253 -0
  35. package/data/llms/components/fileupload.md +459 -0
  36. package/data/llms/components/floatlabel.md +144 -0
  37. package/data/llms/components/fluid.md +104 -0
  38. package/data/llms/components/focustrap.md +59 -0
  39. package/data/llms/components/forms.md +344 -0
  40. package/data/llms/components/galleria.md +1119 -0
  41. package/data/llms/components/gallery.md +1003 -0
  42. package/data/llms/components/iconfield.md +283 -0
  43. package/data/llms/components/iftalabel.md +96 -0
  44. package/data/llms/components/image.md +179 -0
  45. package/data/llms/components/imagecompare.md +108 -0
  46. package/data/llms/components/inplace.md +183 -0
  47. package/data/llms/components/inputcolor.md +869 -0
  48. package/data/llms/components/inputgroup.md +419 -0
  49. package/data/llms/components/inputmask.md +345 -0
  50. package/data/llms/components/inputnumber.md +551 -0
  51. package/data/llms/components/inputotp.md +345 -0
  52. package/data/llms/components/inputpassword.md +738 -0
  53. package/data/llms/components/inputtags.md +432 -0
  54. package/data/llms/components/inputtext.md +569 -0
  55. package/data/llms/components/installation.md +1 -0
  56. package/data/llms/components/keyfilter.md +116 -0
  57. package/data/llms/components/knob.md +318 -0
  58. package/data/llms/components/label.md +151 -0
  59. package/data/llms/components/laravel.md +53 -0
  60. package/data/llms/components/listbox.md +636 -0
  61. package/data/llms/components/mask.md +203 -0
  62. package/data/llms/components/mcp.md +39 -0
  63. package/data/llms/components/megamenu.md +563 -0
  64. package/data/llms/components/menu.md +651 -0
  65. package/data/llms/components/menubar.md +446 -0
  66. package/data/llms/components/message.md +497 -0
  67. package/data/llms/components/metergroup.md +281 -0
  68. package/data/llms/components/multiselect.md +752 -0
  69. package/data/llms/components/orderlist.md +224 -0
  70. package/data/llms/components/organizationchart.md +418 -0
  71. package/data/llms/components/paginator.md +221 -0
  72. package/data/llms/components/panel.md +321 -0
  73. package/data/llms/components/panelmenu.md +703 -0
  74. package/data/llms/components/password.md +657 -0
  75. package/data/llms/components/picklist.md +286 -0
  76. package/data/llms/components/popover.md +145 -0
  77. package/data/llms/components/progressbar.md +242 -0
  78. package/data/llms/components/progressspinner.md +104 -0
  79. package/data/llms/components/radiobutton.md +427 -0
  80. package/data/llms/components/rating.md +312 -0
  81. package/data/llms/components/ripple.md +91 -0
  82. package/data/llms/components/scrollarea.md +700 -0
  83. package/data/llms/components/scrollpanel.md +131 -0
  84. package/data/llms/components/scrolltop.md +87 -0
  85. package/data/llms/components/select.md +1251 -0
  86. package/data/llms/components/selectbutton.md +268 -0
  87. package/data/llms/components/sidebar.md +2232 -0
  88. package/data/llms/components/skeleton.md +302 -0
  89. package/data/llms/components/slider.md +416 -0
  90. package/data/llms/components/speeddial.md +402 -0
  91. package/data/llms/components/splitbutton.md +840 -0
  92. package/data/llms/components/splitter.md +447 -0
  93. package/data/llms/components/stepper.md +551 -0
  94. package/data/llms/components/styleclass.md +226 -0
  95. package/data/llms/components/tabs.md +609 -0
  96. package/data/llms/components/tag.md +178 -0
  97. package/data/llms/components/terminal.md +123 -0
  98. package/data/llms/components/textarea.md +519 -0
  99. package/data/llms/components/tieredmenu.md +578 -0
  100. package/data/llms/components/timeline.md +494 -0
  101. package/data/llms/components/toast.md +472 -0
  102. package/data/llms/components/togglebutton.md +276 -0
  103. package/data/llms/components/toggleswitch.md +271 -0
  104. package/data/llms/components/toolbar.md +140 -0
  105. package/data/llms/components/tooltip.md +160 -0
  106. package/data/llms/components/tree.md +1076 -0
  107. package/data/llms/components/treeselect.md +660 -0
  108. package/data/llms/components/treetable.md +2493 -0
  109. package/data/llms/components/virtualscroller.md +265 -0
  110. package/data/llms/guides/autoimport.md +28 -0
  111. package/data/llms/guides/cdn.md +72 -0
  112. package/data/llms/guides/configuration.md +158 -0
  113. package/data/llms/guides/customicons.md +67 -0
  114. package/data/llms/guides/guides/accessibility.md +27 -0
  115. package/data/llms/guides/guides/animations.md +119 -0
  116. package/data/llms/guides/guides/rtl.md +7 -0
  117. package/data/llms/guides/icons.md +136 -0
  118. package/data/llms/guides/installation.md +3 -0
  119. package/data/llms/guides/laravel.md +66 -0
  120. package/data/llms/guides/llms.md +15 -0
  121. package/data/llms/guides/mcp.md +104 -0
  122. package/data/llms/guides/migration/v4.md +15 -0
  123. package/data/llms/guides/migration/v5.md +15 -0
  124. package/data/llms/guides/nuxt.md +141 -0
  125. package/data/llms/guides/passthrough.md +137 -0
  126. package/data/llms/guides/primeclt.md +43 -0
  127. package/data/llms/guides/tailwind.md +151 -0
  128. package/data/llms/guides/theming/styled.md +497 -0
  129. package/data/llms/guides/theming/unstyled.md +57 -0
  130. package/data/llms/guides/uikit.md +3 -0
  131. package/data/llms/guides/vite.md +90 -0
  132. package/data/llms/llms-full.txt +54465 -0
  133. package/data/llms/llms.txt +132 -0
  134. package/data/llms/pages/accessibility.md +27 -0
  135. package/data/llms/pages/animations.md +119 -0
  136. package/data/llms/pages/autoimport.md +28 -0
  137. package/data/llms/pages/cdn.md +72 -0
  138. package/data/llms/pages/configuration.md +158 -0
  139. package/data/llms/pages/contribution.md +31 -0
  140. package/data/llms/pages/customicons.md +67 -0
  141. package/data/llms/pages/designer.md +79 -0
  142. package/data/llms/pages/dynamicimports.md +7 -0
  143. package/data/llms/pages/forms.md +63 -0
  144. package/data/llms/pages/guides/accessibility.md +27 -0
  145. package/data/llms/pages/guides/animations.md +119 -0
  146. package/data/llms/pages/guides/rtl.md +7 -0
  147. package/data/llms/pages/icons.md +136 -0
  148. package/data/llms/pages/installation.md +3 -0
  149. package/data/llms/pages/introduction.md +23 -0
  150. package/data/llms/pages/laravel.md +66 -0
  151. package/data/llms/pages/llms.md +15 -0
  152. package/data/llms/pages/mcp.md +104 -0
  153. package/data/llms/pages/migration/v4.md +15 -0
  154. package/data/llms/pages/migration/v5.md +15 -0
  155. package/data/llms/pages/nuxt.md +141 -0
  156. package/data/llms/pages/passthrough.md +137 -0
  157. package/data/llms/pages/primeclt.md +43 -0
  158. package/data/llms/pages/rtl.md +7 -0
  159. package/data/llms/pages/setup.md +3 -0
  160. package/data/llms/pages/styled.md +497 -0
  161. package/data/llms/pages/tailwind.md +151 -0
  162. package/data/llms/pages/theming/styled.md +497 -0
  163. package/data/llms/pages/theming/unstyled.md +57 -0
  164. package/data/llms/pages/uikit.md +3 -0
  165. package/data/llms/pages/unstyled.md +57 -0
  166. package/data/llms/pages/v4.md +15 -0
  167. package/data/llms/pages/v5.md +15 -0
  168. package/data/llms/pages/vite.md +90 -0
  169. package/data/manifest.json +11117 -0
  170. package/data/mcp-data.json +55940 -0
  171. package/dist/index.d.ts +17 -1
  172. package/dist/index.js +66066 -72541
  173. package/package.json +10 -12
@@ -0,0 +1,995 @@
1
+ # AutoComplete
2
+
3
+ AutoComplete is an input component that provides real-time suggestions when being typed.
4
+
5
+ ## Basic
6
+
7
+ AutoComplete uses v-model for two-way binding, requires a list of suggestions and a complete method to query for the results. The complete handler gets the query text as event.query property and should update the suggestions with the search results. Use optionLabel to display a property of an object as the suggestion label.
8
+
9
+ ```vue
10
+ <template>
11
+ <div class="flex justify-center">
12
+ <AutoComplete v-model="selectedCommand" :suggestions="filteredCommands" @complete="search" optionLabel="label" placeholder="Type a command..." inputClass="w-full md:w-56" scrollHeight="14rem" />
13
+ </div>
14
+ </template>
15
+
16
+ <script setup>
17
+ import { ref } from 'vue';
18
+
19
+ const selectedCommand = ref();
20
+ const filteredCommands = ref([]);
21
+ const commands = ref([
22
+ { label: 'New File', shortcut: '⌘N' },
23
+ { label: 'Open File', shortcut: '⌘O' },
24
+ { label: 'Save', shortcut: '⌘S' },
25
+ { label: 'Save As', shortcut: '⇧⌘S' },
26
+ { label: 'Find', shortcut: '⌘F' },
27
+ { label: 'Replace', shortcut: '⌘H' },
28
+ { label: 'Go to Line', shortcut: '⌘G' },
29
+ { label: 'Toggle Sidebar', shortcut: '⌘B' },
30
+ { label: 'Split Editor', shortcut: '⌘\\\\' },
31
+ { label: 'Close Tab', shortcut: '⌘W' }
32
+ ]);
33
+
34
+ const search = (event) => {
35
+ const query = event.query.toLowerCase();
36
+
37
+ filteredCommands.value = query ? commands.value.filter((cmd) => cmd.label.toLowerCase().includes(query)) : [...commands.value];
38
+ };
39
+ <\/script>
40
+ ```
41
+
42
+ ## Dropdown
43
+
44
+ Enabling dropdown property displays a trigger button next to the input field. The dropdownMode property defines the behavior of the button, blank sends an empty query and current sends the current value of the input.
45
+
46
+ ```vue
47
+ <template>
48
+ <div class="flex justify-center">
49
+ <AutoComplete v-model="value" dropdown :suggestions="items" @complete="search" inputClass="w-full md:w-56" scrollHeight="14rem" />
50
+ </div>
51
+ </template>
52
+
53
+ <script setup>
54
+ import { ref } from 'vue';
55
+
56
+ const value = ref();
57
+ const items = ref([]);
58
+
59
+ const search = (event) => {
60
+ items.value = event.query ? [...Array(10).keys()].map((item) => event.query + '-' + item) : [...Array(10).keys()].map(String);
61
+ };
62
+ <\/script>
63
+ ```
64
+
65
+ ## Custom Option
66
+
67
+ Customize option content with the option slot.
68
+
69
+ ```vue
70
+ <template>
71
+ <div class="flex justify-center">
72
+ <AutoComplete v-model="selectedMember" :suggestions="filteredMembers" @complete="search" optionLabel="name" placeholder="Search team members..." inputClass="w-full md:w-56" scrollHeight="16rem">
73
+ <template #option="slotProps">
74
+ <div class="flex items-center gap-3 py-1">
75
+ <div class="relative">
76
+ <Avatar :label="slotProps.option.avatar" shape="circle" class="w-8 h-8" />
77
+ <span class="absolute -bottom-0.5 -right-0.5 w-3 h-3 rounded-full border-2 border-surface-0 dark:border-surface-900" :class="slotProps.option.statusClass"></span>
78
+ </div>
79
+ <div class="flex flex-col">
80
+ <span class="font-medium">{{ slotProps.option.name }}</span>
81
+ <span class="text-xs text-surface-500 dark:text-surface-400">{{ slotProps.option.role }}</span>
82
+ </div>
83
+ </div>
84
+ </template>
85
+ </AutoComplete>
86
+ </div>
87
+ </template>
88
+
89
+ <script setup>
90
+ import { ref } from 'vue';
91
+
92
+ const selectedMember = ref();
93
+ const filteredMembers = ref([]);
94
+ const teamMembers = ref([
95
+ { id: 1, name: 'Sarah Chen', role: 'Engineering Lead', avatar: 'SC', status: 'online', statusClass: 'bg-green-400' },
96
+ { id: 2, name: 'Alex Rivera', role: 'Senior Developer', avatar: 'AR', status: 'online', statusClass: 'bg-green-400' },
97
+ { id: 3, name: 'Jordan Kim', role: 'UX Designer', avatar: 'JK', status: 'away', statusClass: 'bg-amber-400' },
98
+ { id: 4, name: 'Taylor Morgan', role: 'Product Manager', avatar: 'TM', status: 'offline', statusClass: 'bg-zinc-400' },
99
+ { id: 5, name: 'Morgan Lee', role: 'DevOps Engineer', avatar: 'ML', status: 'online', statusClass: 'bg-green-400' },
100
+ { id: 6, name: 'Casey Jones', role: 'QA Engineer', avatar: 'CJ', status: 'away', statusClass: 'bg-amber-400' }
101
+ ]);
102
+
103
+ const search = (event) => {
104
+ const query = event.query.toLowerCase();
105
+
106
+ filteredMembers.value = query ? teamMembers.value.filter((m) => m.name.toLowerCase().includes(query) || m.role.toLowerCase().includes(query)) : [...teamMembers.value];
107
+ };
108
+ <\/script>
109
+ ```
110
+
111
+ ## Simple
112
+
113
+ Options can be grouped by category using the optionGroupLabel and optionGroupChildren properties.
114
+
115
+ ```vue
116
+ <template>
117
+ <div class="flex justify-center">
118
+ <AutoComplete
119
+ v-model="selectedTech"
120
+ :suggestions="filteredGroups"
121
+ @complete="search"
122
+ optionLabel="label"
123
+ optionGroupLabel="label"
124
+ optionGroupChildren="items"
125
+ placeholder="Search technologies..."
126
+ inputClass="w-full md:w-56"
127
+ scrollHeight="14rem"
128
+ />
129
+ </div>
130
+ </template>
131
+
132
+ <script setup>
133
+ import { ref } from 'vue';
134
+
135
+ const selectedTech = ref();
136
+ const filteredGroups = ref([]);
137
+ const techStack = ref([
138
+ {
139
+ label: 'Frontend',
140
+ code: 'FE',
141
+ items: [
142
+ { label: 'React', value: 'react' },
143
+ { label: 'Vue', value: 'vue' },
144
+ { label: 'Angular', value: 'angular' },
145
+ { label: 'Svelte', value: 'svelte' }
146
+ ]
147
+ },
148
+ {
149
+ label: 'Backend',
150
+ code: 'BE',
151
+ items: [
152
+ { label: 'Node.js', value: 'nodejs' },
153
+ { label: 'Python', value: 'python' },
154
+ { label: 'Java', value: 'java' },
155
+ { label: 'Go', value: 'go' }
156
+ ]
157
+ },
158
+ {
159
+ label: 'Database',
160
+ code: 'DB',
161
+ items: [
162
+ { label: 'PostgreSQL', value: 'postgresql' },
163
+ { label: 'MongoDB', value: 'mongodb' },
164
+ { label: 'Redis', value: 'redis' },
165
+ { label: 'MySQL', value: 'mysql' }
166
+ ]
167
+ }
168
+ ]);
169
+
170
+ const search = (event) => {
171
+ const query = event.query.toLowerCase();
172
+ const filtered = [];
173
+
174
+ for (const category of techStack.value) {
175
+ const filteredItems = query ? category.items.filter((item) => item.label.toLowerCase().includes(query)) : category.items;
176
+
177
+ if (filteredItems.length) {
178
+ filtered.push({ ...category, items: filteredItems });
179
+ }
180
+ }
181
+
182
+ filteredGroups.value = filtered;
183
+ };
184
+ <\/script>
185
+ ```
186
+
187
+ ## Custom
188
+
189
+ Customize group headers with the optiongroup slot.
190
+
191
+ ```vue
192
+ <template>
193
+ <div class="flex justify-center">
194
+ <AutoComplete
195
+ v-model="selectedCity"
196
+ :suggestions="filteredGroups"
197
+ @complete="search"
198
+ optionLabel="label"
199
+ optionGroupLabel="label"
200
+ optionGroupChildren="items"
201
+ placeholder="Search a city..."
202
+ inputClass="w-full md:w-56"
203
+ scrollHeight="18rem"
204
+ :pt="{ optiongroup: 'border-b border-surface' }"
205
+ >
206
+ <template #optiongroup="slotProps">
207
+ <div class="flex items-center gap-2">
208
+ <span>{{ countryFlags[slotProps.option.value] }}</span>
209
+ <span>{{ slotProps.option.label }}</span>
210
+ </div>
211
+ </template>
212
+ </AutoComplete>
213
+ </div>
214
+ </template>
215
+
216
+ <script setup>
217
+ import { ref } from 'vue';
218
+
219
+ const selectedCity = ref();
220
+ const filteredGroups = ref([]);
221
+ const countryFlags = ref({
222
+ de: '🇩🇪',
223
+ us: '🇺🇸',
224
+ jp: '🇯🇵'
225
+ });
226
+ const groupedCities = ref([
227
+ {
228
+ label: 'Germany',
229
+ value: 'de',
230
+ items: [
231
+ { label: 'Berlin', value: 'Berlin' },
232
+ { label: 'Frankfurt', value: 'Frankfurt' },
233
+ { label: 'Hamburg', value: 'Hamburg' }
234
+ ]
235
+ },
236
+ {
237
+ label: 'USA',
238
+ value: 'us',
239
+ items: [
240
+ { label: 'Chicago', value: 'Chicago' },
241
+ { label: 'Los Angeles', value: 'Los Angeles' },
242
+ { label: 'New York', value: 'New York' }
243
+ ]
244
+ },
245
+ {
246
+ label: 'Japan',
247
+ value: 'jp',
248
+ items: [
249
+ { label: 'Kyoto', value: 'Kyoto' },
250
+ { label: 'Osaka', value: 'Osaka' },
251
+ { label: 'Tokyo', value: 'Tokyo' }
252
+ ]
253
+ }
254
+ ]);
255
+
256
+ const search = (event) => {
257
+ const query = event.query.toLowerCase();
258
+ const filtered = [];
259
+
260
+ for (const group of groupedCities.value) {
261
+ const filteredItems = query ? group.items.filter((item) => item.label.toLowerCase().includes(query)) : group.items;
262
+
263
+ if (filteredItems.length) {
264
+ filtered.push({ ...group, items: filteredItems });
265
+ }
266
+ }
267
+
268
+ filteredGroups.value = filtered;
269
+ };
270
+ <\/script>
271
+ ```
272
+
273
+ ## Force Selection
274
+
275
+ ForceSelection mode validates the manual input to check whether it also exists in the suggestions list, if not the input value is cleared to make sure the value passed to the model is always one of the suggestions.
276
+
277
+ ```vue
278
+ <template>
279
+ <div class="flex justify-center">
280
+ <AutoComplete v-model="selectedCountry" forceSelection :suggestions="filteredCountries" @complete="search" optionLabel="name" inputClass="w-full md:w-56" scrollHeight="14rem" />
281
+ </div>
282
+ </template>
283
+
284
+ <script setup>
285
+ import { ref, onMounted } from 'vue';
286
+ import { CountryService } from '@/service/CountryService';
287
+
288
+ onMounted(() => {
289
+ CountryService.getCountries().then((data) => (countries.value = data));
290
+ });
291
+
292
+ const countries = ref();
293
+ const selectedCountry = ref();
294
+ const filteredCountries = ref();
295
+
296
+ const search = (event) => {
297
+ let query = event.query;
298
+ let filtered = [];
299
+
300
+ for (let i = 0; i < countries.value.length; i++) {
301
+ let country = countries.value[i];
302
+
303
+ if (country.name.toLowerCase().indexOf(query.toLowerCase()) === 0) {
304
+ filtered.push(country);
305
+ }
306
+ }
307
+
308
+ filteredCountries.value = filtered;
309
+ };
310
+ <\/script>
311
+ ```
312
+
313
+ ## Float Label
314
+
315
+ A floating label appears on top of the input field when focused. Visit FloatLabel documentation for more information.
316
+
317
+ ```vue
318
+ <template>
319
+ <div class="flex flex-wrap justify-center items-end gap-4">
320
+ <FloatLabel>
321
+ <AutoComplete v-model="value1" inputId="over_label" :suggestions="items" @complete="search" scrollHeight="14rem" />
322
+ <label for="over_label">Over Label</label>
323
+ </FloatLabel>
324
+
325
+ <FloatLabel variant="in">
326
+ <AutoComplete v-model="value2" inputId="in_label" :suggestions="items" @complete="search" scrollHeight="14rem" />
327
+ <label for="in_label">In Label</label>
328
+ </FloatLabel>
329
+
330
+ <FloatLabel variant="on">
331
+ <AutoComplete v-model="value3" inputId="on_label" :suggestions="items" @complete="search" scrollHeight="14rem" />
332
+ <label for="on_label">On Label</label>
333
+ </FloatLabel>
334
+ </div>
335
+ </template>
336
+
337
+ <script setup>
338
+ import { ref } from 'vue';
339
+
340
+ const value1 = ref();
341
+ const value2 = ref();
342
+ const value3 = ref();
343
+ const items = ref([]);
344
+
345
+ const search = (event) => {
346
+ items.value = [...Array(10).keys()].map((item) => event.query + '-' + item);
347
+ };
348
+ <\/script>
349
+ ```
350
+
351
+ ## Ifta Label
352
+
353
+ IftaLabel is used to create infield top aligned labels. Visit IftaLabel documentation for more information.
354
+
355
+ ```vue
356
+ <template>
357
+ <div class="flex justify-center">
358
+ <IftaLabel>
359
+ <AutoComplete v-model="value" inputId="ac" :suggestions="items" @complete="search" inputClass="w-full md:w-56" scrollHeight="14rem" />
360
+ <label for="ac">Identifier</label>
361
+ </IftaLabel>
362
+ </div>
363
+ </template>
364
+
365
+ <script setup>
366
+ import { ref } from 'vue';
367
+
368
+ const value = ref();
369
+ const items = ref([]);
370
+
371
+ const search = (event) => {
372
+ items.value = [...Array(10).keys()].map((item) => event.query + '-' + item);
373
+ };
374
+ <\/script>
375
+ ```
376
+
377
+ ## Clear Icon
378
+
379
+ When showClear is enabled, a clear icon is displayed to reset the value.
380
+
381
+ ```vue
382
+ <template>
383
+ <div class="flex justify-center">
384
+ <AutoComplete v-model="selectedCategory" :suggestions="filteredCategories" @complete="search" optionLabel="label" showClear placeholder="Search categories..." inputClass="w-full md:w-56" scrollHeight="14rem">
385
+ <template #option="slotProps">
386
+ <div class="flex items-center justify-between w-full">
387
+ <span>{{ slotProps.option.label }}</span>
388
+ <Tag :value="slotProps.option.count.toString()" severity="secondary" rounded />
389
+ </div>
390
+ </template>
391
+ </AutoComplete>
392
+ </div>
393
+ </template>
394
+
395
+ <script setup>
396
+ import { ref } from 'vue';
397
+
398
+ const selectedCategory = ref();
399
+ const filteredCategories = ref([]);
400
+ const productCategories = ref([
401
+ { label: 'Electronics', value: 'electronics', count: 1247 },
402
+ { label: 'Clothing', value: 'clothing', count: 856 },
403
+ { label: 'Garden', value: 'home', count: 634 },
404
+ { label: 'Sports', value: 'sports', count: 421 },
405
+ { label: 'Books', value: 'books', count: 2103 },
406
+ { label: 'Toys', value: 'toys', count: 312 }
407
+ ]);
408
+
409
+ const search = (event) => {
410
+ const query = event.query.toLowerCase();
411
+
412
+ filteredCategories.value = query ? productCategories.value.filter((cat) => cat.label.toLowerCase().includes(query)) : [...productCategories.value];
413
+ };
414
+ <\/script>
415
+ ```
416
+
417
+ ## Fluid
418
+
419
+ The fluid prop makes the component take up the full width of its container when set to true.
420
+
421
+ ```vue
422
+ <template>
423
+ <div>
424
+ <AutoComplete v-model="value" :suggestions="items" @complete="search" fluid scrollHeight="14rem" />
425
+ </div>
426
+ </template>
427
+
428
+ <script setup>
429
+ import { ref } from 'vue';
430
+
431
+ const value = ref();
432
+ const items = ref([]);
433
+
434
+ const search = (event) => {
435
+ items.value = [...Array(10).keys()].map((item) => event.query + '-' + item);
436
+ };
437
+ <\/script>
438
+ ```
439
+
440
+ ## Loading
441
+
442
+ Compose a loading indicator alongside the autocomplete input using InputGroup .
443
+
444
+ ```vue
445
+ <template>
446
+ <div class="flex justify-center">
447
+ <div class="w-full md:w-56">
448
+ <InputGroup>
449
+ <AutoComplete v-model="value" :suggestions="items" @complete="search" scrollHeight="14rem" />
450
+ <InputGroupAddon>
451
+ <Spinner class="animate-spin" />
452
+ </InputGroupAddon>
453
+ </InputGroup>
454
+ </div>
455
+ </div>
456
+ </template>
457
+
458
+ <script setup>
459
+ import { ref } from 'vue';
460
+ import Spinner from '@primeicons/vue/spinner';
461
+
462
+ const value = ref();
463
+ const items = ref([]);
464
+
465
+ const search = (event) => {
466
+ items.value = [...Array(10).keys()].map((item) => event.query + '-' + item);
467
+ };
468
+ <\/script>
469
+ ```
470
+
471
+ ## Sizes
472
+
473
+ AutoComplete provides small and large sizes as alternatives to the base.
474
+
475
+ ```vue
476
+ <template>
477
+ <div class="flex flex-col items-center gap-4">
478
+ <AutoComplete v-model="value1" :suggestions="items" @complete="search" size="small" placeholder="Small" scrollHeight="14rem" />
479
+ <AutoComplete v-model="value2" :suggestions="items" @complete="search" placeholder="Normal" scrollHeight="14rem" />
480
+ <AutoComplete v-model="value3" :suggestions="items" @complete="search" size="large" placeholder="Large" scrollHeight="14rem" />
481
+ </div>
482
+ </template>
483
+
484
+ <script setup>
485
+ import { ref } from 'vue';
486
+
487
+ const value1 = ref();
488
+ const value2 = ref();
489
+ const value3 = ref();
490
+ const items = ref([]);
491
+
492
+ const search = (event) => {
493
+ items.value = [...Array(10).keys()].map((item) => event.query + '-' + item);
494
+ };
495
+ <\/script>
496
+ ```
497
+
498
+ ## Filled
499
+
500
+ Specify the variant property as filled to display the component with a higher visual emphasis than the default outlined style.
501
+
502
+ ```vue
503
+ <template>
504
+ <div class="flex justify-center">
505
+ <AutoComplete v-model="value" :suggestions="items" @complete="search" variant="filled" inputClass="w-full md:w-56" scrollHeight="14rem" />
506
+ </div>
507
+ </template>
508
+
509
+ <script setup>
510
+ import { ref } from 'vue';
511
+
512
+ const value = ref();
513
+ const items = ref([]);
514
+
515
+ const search = (event) => {
516
+ items.value = [...Array(10).keys()].map((item) => event.query + '-' + item);
517
+ };
518
+ <\/script>
519
+ ```
520
+
521
+ ## Disabled
522
+
523
+ When disabled is present, the element cannot be edited and focused.
524
+
525
+ ```vue
526
+ <template>
527
+ <div class="flex justify-center">
528
+ <AutoComplete v-model="value" :suggestions="items" @complete="search" disabled placeholder="Disabled" inputClass="w-full md:w-56" scrollHeight="14rem" />
529
+ </div>
530
+ </template>
531
+
532
+ <script setup>
533
+ import { ref } from 'vue';
534
+
535
+ const value = ref();
536
+ const items = ref([]);
537
+
538
+ const search = (event) => {
539
+ items.value = [...Array(10).keys()].map((item) => event.query + '-' + item);
540
+ };
541
+ <\/script>
542
+ ```
543
+
544
+ ## Invalid
545
+
546
+ The invalid state is applied using the invalid property to indicate failed validation, which can be integrated with form validation libraries.
547
+
548
+ ```vue
549
+ <template>
550
+ <div class="flex flex-wrap justify-center gap-4">
551
+ <AutoComplete v-model="value1" :suggestions="items" @complete="search" :invalid="!value1" placeholder="Search" inputClass="w-full md:w-56" scrollHeight="14rem" />
552
+ <AutoComplete v-model="value2" :suggestions="items" @complete="search" :invalid="!value2" variant="filled" placeholder="Search" inputClass="w-full md:w-56" scrollHeight="14rem" />
553
+ </div>
554
+ </template>
555
+
556
+ <script setup>
557
+ import { ref } from 'vue';
558
+
559
+ const value1 = ref();
560
+ const value2 = ref();
561
+ const items = ref([]);
562
+
563
+ const search = (event) => {
564
+ items.value = [...Array(10).keys()].map((item) => event.query + '-' + item);
565
+ };
566
+ <\/script>
567
+ ```
568
+
569
+ ## Focus Behavior
570
+
571
+ Customize keyboard and mouse focus behavior with autoOptionFocus , selectOnFocus , and focusOnHover properties.
572
+
573
+ ```vue
574
+ <template>
575
+ <div class="space-y-4">
576
+ <div class="flex flex-wrap gap-2 justify-center">
577
+ <Button size="small" :severity="autoOptionFocus ? 'primary' : 'secondary'" @click="autoOptionFocus = !autoOptionFocus">{{ \`autoOptionFocus: \${autoOptionFocus}\` }}</Button>
578
+ <Button size="small" :severity="selectOnFocus ? 'primary' : 'secondary'" @click="selectOnFocus = !selectOnFocus">{{ \`selectOnFocus: \${selectOnFocus}\` }}</Button>
579
+ <Button size="small" :severity="focusOnHover ? 'primary' : 'secondary'" @click="focusOnHover = !focusOnHover">{{ \`focusOnHover: \${focusOnHover}\` }}</Button>
580
+ </div>
581
+ <div class="flex justify-center">
582
+ <AutoComplete
583
+ v-model="value"
584
+ :suggestions="items"
585
+ @complete="search"
586
+ :autoOptionFocus="autoOptionFocus"
587
+ :selectOnFocus="selectOnFocus"
588
+ :focusOnHover="focusOnHover"
589
+ placeholder="Search a city..."
590
+ inputClass="w-full md:w-56"
591
+ scrollHeight="14rem"
592
+ />
593
+ </div>
594
+ </div>
595
+ </template>
596
+
597
+ <script setup>
598
+ import { ref } from 'vue';
599
+
600
+ const value = ref();
601
+ const items = ref([]);
602
+ const autoOptionFocus = ref(true);
603
+ const selectOnFocus = ref(false);
604
+ const focusOnHover = ref(true);
605
+
606
+ const search = (event) => {
607
+ items.value = [...Array(10).keys()].map((item) => event.query + '-' + item);
608
+ };
609
+ <\/script>
610
+ ```
611
+
612
+ ## Objects
613
+
614
+ AutoComplete can also work with objects using the optionLabel property that defines the label to display as a suggestion. The value passed to the model would still be the object instance of a suggestion. Here is an example with a Country object that has name and code fields such as &#123;name: "United States", code:"USA"&#125; .
615
+
616
+ ```vue
617
+ <template>
618
+ <div class="flex justify-center">
619
+ <AutoComplete v-model="selectedCountry" :suggestions="filteredCountries" @complete="search" optionLabel="name" inputClass="w-full md:w-56" scrollHeight="14rem" placeholder="Search a country..." />
620
+ </div>
621
+ </template>
622
+
623
+ <script setup>
624
+ import { ref, onMounted } from 'vue';
625
+ import { CountryService } from '@/service/CountryService';
626
+
627
+ onMounted(() => {
628
+ CountryService.getCountries().then((data) => (countries.value = data));
629
+ });
630
+
631
+ const countries = ref();
632
+ const selectedCountry = ref();
633
+ const filteredCountries = ref();
634
+
635
+ const search = (event) => {
636
+ let query = event.query;
637
+ let filtered = [];
638
+
639
+ for (let i = 0; i < countries.value.length; i++) {
640
+ let country = countries.value[i];
641
+
642
+ if (country.name.toLowerCase().indexOf(query.toLowerCase()) === 0) {
643
+ filtered.push(country);
644
+ }
645
+ }
646
+
647
+ filteredCountries.value = filtered;
648
+ };
649
+ <\/script>
650
+ ```
651
+
652
+ ## Template
653
+
654
+ AutoComplete offers multiple slots for customization through templating.
655
+
656
+ ```vue
657
+ <template>
658
+ <div class="flex justify-center">
659
+ <AutoComplete v-model="selectedCountry" :suggestions="filteredCountries" @complete="search" optionLabel="name" inputClass="w-full md:w-56" scrollHeight="14rem">
660
+ <template #option="slotProps">
661
+ <div class="flex items-center gap-2">
662
+ <img :alt="slotProps.option.name" src="https://primefaces.org/cdn/primevue/images/flag/flag_placeholder.png" :class="\`flag flag-\${slotProps.option.code.toLowerCase()}\`" style="width: 18px" />
663
+ <div>{{ slotProps.option.name }}</div>
664
+ </div>
665
+ </template>
666
+ <template #header>
667
+ <div class="font-medium px-3 py-2">Available Countries</div>
668
+ </template>
669
+ <template #footer>
670
+ <div class="px-3 py-3">
671
+ <Button fluid severity="secondary" text size="small">
672
+ <Plus />
673
+ Add New
674
+ </Button>
675
+ </div>
676
+ </template>
677
+ </AutoComplete>
678
+ </div>
679
+ </template>
680
+
681
+ <script setup>
682
+ import { ref, onMounted } from 'vue';
683
+ import { CountryService } from '@/service/CountryService';
684
+ import Plus from '@primeicons/vue/plus';
685
+
686
+ onMounted(() => {
687
+ CountryService.getCountries().then((data) => (countries.value = data));
688
+ });
689
+
690
+ const countries = ref();
691
+ const selectedCountry = ref();
692
+ const filteredCountries = ref();
693
+
694
+ const search = (event) => {
695
+ let query = event.query;
696
+ let filtered = [];
697
+
698
+ for (let i = 0; i < countries.value.length; i++) {
699
+ let country = countries.value[i];
700
+
701
+ if (country.name.toLowerCase().indexOf(query.toLowerCase()) === 0) {
702
+ filtered.push(country);
703
+ }
704
+ }
705
+
706
+ filteredCountries.value = filtered;
707
+ };
708
+ <\/script>
709
+ ```
710
+
711
+ ## Virtual Scroll
712
+
713
+ Virtual scrolling is an efficient way of rendering the options by displaying a small subset of data in the viewport at any time. When dealing with huge number of options, it is suggested to enable virtual scrolling to avoid performance issues. Configuration of the scroll behavior is defined with virtualScrollerOptions that requires itemSize as the mandatory value to set the height of an item. Visit VirtualScroller documentation for more information about the configuration API.
714
+
715
+ ```vue
716
+ <template>
717
+ <div class="flex justify-center">
718
+ <AutoComplete v-model="selectedItem" :suggestions="filteredItems" @complete="search" :virtualScrollerOptions="{ itemSize: 34 }" optionLabel="label" dropdown />
719
+ </div>
720
+ </template>
721
+
722
+ <script setup>
723
+ import { ref } from 'vue';
724
+
725
+ const items = ref(Array.from({ length: 10000 }, (_, i) => ({ label: 'Item ' + i, value: 'Item ' + i })));
726
+ const selectedItem = ref();
727
+ const filteredItems = ref();
728
+
729
+ const search = (event) => {
730
+ //in a real application, make a request to a remote url with the query and return filtered results, for demo we filter at client side
731
+ let query = event.query;
732
+ let filtered = [];
733
+
734
+ for (let i = 0; i < items.value.length; i++) {
735
+ let item = items.value[i];
736
+
737
+ if (item.label.toLowerCase().indexOf(query.toLowerCase()) === 0) {
738
+ filtered.push(item);
739
+ }
740
+ }
741
+
742
+ filteredItems.value = filtered;
743
+ };
744
+ <\/script>
745
+ ```
746
+
747
+ ## Forms
748
+
749
+ AutoComplete integrates seamlessly with the PrimeVue Forms library.
750
+
751
+ ```vue
752
+ <template>
753
+ <div class="flex justify-center">
754
+ <Form v-slot="$form" :resolver="resolver" :initialValues="initialValues" @submit="onFormSubmit" class="flex justify-center flex-col gap-4 w-full md:w-56">
755
+ <div class="flex flex-col gap-1">
756
+ <AutoComplete name="value" :suggestions="items" @complete="search" fluid />
757
+ <Message v-if="$form.value?.invalid" severity="error" size="small" variant="simple">{{ $form.value.error?.message }}</Message>
758
+ </div>
759
+ <Button type="submit" severity="secondary">Submit</Button>
760
+ </Form>
761
+ </div>
762
+ </template>
763
+
764
+ <script setup>
765
+ import { ref } from 'vue';
766
+ import { zodResolver } from '@primevue/forms/resolvers/zod';
767
+ import { useToast } from 'primevue/usetoast';
768
+ import { z } from 'zod';
769
+
770
+ const toast = useToast();
771
+ const items = ref([]);
772
+ const initialValues = ref({
773
+ value: ''
774
+ });
775
+ const resolver = ref(zodResolver(
776
+ z.object({
777
+ value: z.string().min(1, { message: 'Value is required.' })
778
+ })
779
+ ));
780
+
781
+ const search = (event) => {
782
+ items.value = [...Array(10).keys()].map((item) => event.query + '-' + item);
783
+ };
784
+
785
+ const onFormSubmit = ({ valid }) => {
786
+ if (valid) {
787
+ toast.add({ severity: 'success', summary: 'Form is submitted.', life: 3000 });
788
+ }
789
+ };
790
+ <\/script>
791
+ ```
792
+
793
+ ## Accessibility
794
+
795
+ Screen Reader Value to describe the component can either be provided via label tag combined with inputId prop or using aria-labelledby , aria-label props. The input element has combobox role in addition to aria-autocomplete , aria-haspopup and aria-expanded attributes. The relation between the input and the popup is created with aria-controls and aria-activedescendant attribute is used to instruct screen reader which option to read during keyboard navigation within the popup list. In multiple mode, chip list uses listbox role whereas each chip has the option role with aria-label set to the label of the chip. The popup list has an id that refers to the aria-controls attribute of the input element and uses listbox as the role. Each list item has option role and an id to match the aria-activedescendant of the input element. Keyboard Support Key Function tab Moves focus to the input element when popup is not visible. If the popup is open and an item is highlighted then popup gets closed, item gets selected and focus moves to the next focusable element. up arrow Highlights the previous item if popup is visible. down arrow Highlights the next item if popup is visible. enter Selects the highlighted item and closes the popup if popup is visible. home Highlights the first item if popup is visible. end Highlights the last item if popup is visible. escape Hides the popup. Chips Input Keyboard Support Key Function backspace Deletes the previous chip if the input field is empty. left arrow Moves focus to the previous chip if available and input field is empty. Chip Keyboard Support Key Function left arrow Moves focus to the previous chip if available. right arrow Moves focus to the next chip, if there is none then input field receives the focus. backspace Deletes the chips and adds focus to the input field.
796
+
797
+ ```vue
798
+ <template>
799
+ <label for="ac1">Username</label>
800
+ <AutoComplete inputId="ac1" />
801
+
802
+ <span id="ac2">Email</span>
803
+ <AutoComplete aria-labelledby="ac2" />
804
+
805
+ <AutoComplete aria-label="City" />
806
+ </template>
807
+ ```
808
+
809
+ ## Auto Complete API
810
+
811
+ ### Props
812
+
813
+ | Name |Type |Default |Description |
814
+ | --- | --- | --- | --- |
815
+ | modelValue | any | - | Value of the component. |
816
+ | defaultValue | any | - | The default value for the input when not controlled by `modelValue` . |
817
+ | name | string | - | The name attribute for the element, typically used in form submissions. |
818
+ | suggestions | any[] | - | An array of suggestions to display. |
819
+ | optionLabel | string \| Function | - | Property name or getter function to use as the label of an option. |
820
+ | optionDisabled | string \| Function | - | Property name or getter function to use as the disabled flag of an option, defaults to false when not defined. |
821
+ | optionGroupLabel | string \| Function | - | Property name or getter function to use as the label of an option group. |
822
+ | optionGroupChildren | string \| Function | - | Property name or getter function that refers to the children options of option group. |
823
+ | typeahead | boolean | true | whether typeahead is active or not. |
824
+ | scrollHeight | string | 14rem | Maximum height of the suggestions overlay. |
825
+ | dropdown | boolean | false | Displays a button next to the input field when enabled. |
826
+ | dropdownMode | HintedString<"blank" \| "current"> | blank | Specifies the behavior dropdown button. Default 'blank' mode sends an empty string and 'current' mode sends the input value. |
827
+ | multiple | boolean | false | Specifies if multiple values can be selected. |
828
+ | showClear | boolean | false | When enabled, a clear icon is displayed to clear the value. |
829
+ | placeholder | string | - | Default text to display when no option is selected. |
830
+ | loading | boolean | false | Whether the autocomplete is in loading state. |
831
+ | size | HintedString<"small" \| "large"> | - | Defines the size of the component. |
832
+ | invalid | boolean | false | When present, it specifies that the component should have invalid state style. |
833
+ | disabled | boolean | false | When present, it specifies that the component should be disabled. |
834
+ | variant | null \| HintedString<"outlined" \| "filled"> | null | Specifies the input variant of the component. |
835
+ | dataKey | string | - | A property to uniquely identify an option. |
836
+ | minLength | number | 1 | Minimum number of characters to initiate a search. |
837
+ | delay | number | 300 | Delay between keystrokes to wait before sending a query. |
838
+ | appendTo | HTMLElement \| HintedString<"body" \| "self"> | body | A valid query selector or an HTMLElement to specify where the overlay gets attached. Special keywords are 'body' for document body and 'self' for the element itself. |
839
+ | forceSelection | boolean | false | When present, autocomplete clears the manual input if it does not match of the suggestions to force only accepting values from the suggestions. |
840
+ | completeOnFocus | boolean | false | Whether to run a query when input receives focus. |
841
+ | inputId | string | - | Identifier of the underlying input element. |
842
+ | inputStyle | object | - | Inline style of the input field. |
843
+ | inputClass | string \| object | - | Style class of the input field. |
844
+ | inputProps | InputHTMLAttributes | - | Used to pass all properties of the HTMLInputElement to the focusable input element inside the component. |
845
+ | panelStyle | object | - | Inline style of the overlay. |
846
+ | panelClass | string \| object | - | Style class of the overlay. |
847
+ | overlayStyle | object | - | Inline style of the overlay overlay. |
848
+ | overlayClass | string \| object | - | Style class of the overlay overlay. |
849
+ | dropdownIcon | string | - | Icon to display in the dropdown. |
850
+ | dropdownClass | string \| object | - | Style class of the dropdown button. |
851
+ | loader | string | - | Icon to display in loading state. |
852
+ | chipIcon | string | - | Icon to display in chip remove action. |
853
+ | virtualScrollerOptions | any | - | Whether to use the virtualScroller feature. The properties of VirtualScroller component can be used like an object in it. |
854
+ | autoOptionFocus | boolean | false | Whether to focus on the first visible or selected element when the overlay is shown. |
855
+ | selectOnFocus | boolean | false | When enabled, the focused option is selected. |
856
+ | focusOnHover | boolean | true | When enabled, the focus is placed on the hovered option. |
857
+ | searchLocale | string | - | Locale to use in searching. The default locale is the host environment's current locale. |
858
+ | searchMessage | string | '{0} results are available' | Text to be displayed in hidden accessible field when filtering returns any results. Defaults to value from PrimeVue locale configuration. |
859
+ | selectionMessage | string | '{0} items selected' | Text to be displayed in hidden accessible field when options are selected. Defaults to value from PrimeVue locale configuration. |
860
+ | emptySelectionMessage | string | No selected item | Text to be displayed in hidden accessible field when any option is not selected. Defaults to value from PrimeVue locale configuration. |
861
+ | emptySearchMessage | string | No results found | Text to display when filtering does not return any results. Defaults to value from PrimeVue locale configuration. |
862
+ | showEmptyMessage | boolean | true | When enabled, empty search message will be visible. |
863
+ | tabindex | string \| number | - | Index of the element in tabbing order. |
864
+ | fluid | boolean | null | Spans 100% width of the container when enabled. |
865
+ | ariaLabel | string | - | Defines a string value that labels an interactive element. |
866
+ | ariaLabelledby | string | - | Identifier of the underlying input element. |
867
+ | formControl | Record<string, any> | - | Form control object, typically used for handling validation and form state. |
868
+ | dt | any | - | It generates scoped CSS variables using design tokens for the component. |
869
+ | pt | PassThrough<AutoCompletePassThroughOptions> | - | Used to pass attributes to DOM elements inside the component. |
870
+ | ptOptions | any | - | Used to configure passthrough(pt) options of the component. |
871
+ | unstyled | boolean | false | When enabled, it removes component related styles in the core. |
872
+
873
+ ### Pass Through Options
874
+
875
+ | Name |Type |Description |
876
+ | --- | --- | --- |
877
+ | root | AutoCompletePassThroughOptionType | Used to pass attributes to the root's DOM element. |
878
+ | pcInputText | any | Used to pass attributes to the InputText component. |
879
+ | inputMultiple | AutoCompletePassThroughOptionType | Used to pass attributes to the input multiple's DOM element. |
880
+ | chipItem | AutoCompletePassThroughOptionType | Used to pass attributes to the chip's DOM element. |
881
+ | pcChip | any | Used to pass attributes to the Chip. |
882
+ | chipIcon | AutoCompletePassThroughOptionType | Used to pass attributes to the chip icon's DOM element. |
883
+ | input | AutoCompletePassThroughOptionType | Used to pass attributes to the input chip's DOM element. |
884
+ | inputChip | AutoCompletePassThroughOptionType | Used to pass attributes to the input chip's DOM element. |
885
+ | loader | AutoCompletePassThroughOptionType | Used to pass attributes to the loader's DOM element. |
886
+ | clearIcon | AutoCompletePassThroughOptionType | Used to pass attributes to the clear icon's DOM element. |
887
+ | dropdown | AutoCompletePassThroughOptionType | Used to pass attributes to the dropdown's DOM element. |
888
+ | dropdownIcon | AutoCompletePassThroughOptionType | Used to pass attributes to the dropdown icon's DOM element. |
889
+ | overlay | AutoCompletePassThroughOptionType | Used to pass attributes to the overlay's DOM element. |
890
+ | virtualScroller | any | Used to pass attributes to the VirtualScroller component. |
891
+ | listContainer | AutoCompletePassThroughOptionType | Used to pass attributes to the list container's DOM element. |
892
+ | list | AutoCompletePassThroughOptionType | Used to pass attributes to the list's DOM element. |
893
+ | optionGroup | AutoCompletePassThroughOptionType | Used to pass attributes to the option group's DOM element. |
894
+ | option | AutoCompletePassThroughOptionType | Used to pass attributes to the option's DOM element. |
895
+ | emptyMessage | AutoCompletePassThroughOptionType | Used to pass attributes to the empty message's DOM element. |
896
+ | searchResultMessage | AutoCompletePassThroughOptionType | Used to pass attributes to the search result message's DOM element. |
897
+ | selectedMessage | AutoCompletePassThroughOptionType | Used to pass attributes to the selected message's DOM element. |
898
+ | hooks | any | Used to manage all lifecycle hooks. |
899
+ | transition | AutoCompletePassThroughTransitionType | Used to control Vue Transition API. |
900
+
901
+ ### Theming
902
+
903
+ ### CSS Classes
904
+
905
+ | Class |Description |
906
+ | --- | --- |
907
+ | p-autocomplete | Class name of the root element |
908
+ | p-autocomplete-input | Class name of the input element |
909
+ | p-autocomplete-input-multiple | Class name of the input multiple element |
910
+ | p-autocomplete-clear-icon | Class name of the clear icon element |
911
+ | p-autocomplete-chip-item | Class name of the chip item element |
912
+ | p-autocomplete-chip | Class name of the chip element |
913
+ | p-autocomplete-chip-icon | Class name of the chip icon element |
914
+ | p-autocomplete-input-chip | Class name of the input chip element |
915
+ | p-autocomplete-loader | Class name of the loader element |
916
+ | p-autocomplete-dropdown | Class name of the dropdown element |
917
+ | p-autocomplete-overlay | Class name of the panel element |
918
+ | p-autocomplete-list | Class name of the list element |
919
+ | p-autocomplete-list-container | Class name of the list container element |
920
+ | p-autocomplete-option-group | Class name of the option group element |
921
+ | p-autocomplete-option | Class name of the option element |
922
+ | p-autocomplete-empty-message | Class name of the empty message element |
923
+
924
+ ### Design Tokens
925
+
926
+ | Token |CSS Variable |Description |
927
+ | --- | --- | --- |
928
+ | autocomplete.background | --p-autocomplete-background | Background of root |
929
+ | autocomplete.disabled.background | --p-autocomplete-disabled-background | Disabled background of root |
930
+ | autocomplete.filled.background | --p-autocomplete-filled-background | Filled background of root |
931
+ | autocomplete.filled.hover.background | --p-autocomplete-filled-hover-background | Filled hover background of root |
932
+ | autocomplete.filled.focus.background | --p-autocomplete-filled-focus-background | Filled focus background of root |
933
+ | autocomplete.border.color | --p-autocomplete-border-color | Border color of root |
934
+ | autocomplete.hover.border.color | --p-autocomplete-hover-border-color | Hover border color of root |
935
+ | autocomplete.focus.border.color | --p-autocomplete-focus-border-color | Focus border color of root |
936
+ | autocomplete.invalid.border.color | --p-autocomplete-invalid-border-color | Invalid border color of root |
937
+ | autocomplete.color | --p-autocomplete-color | Color of root |
938
+ | autocomplete.disabled.color | --p-autocomplete-disabled-color | Disabled color of root |
939
+ | autocomplete.placeholder.color | --p-autocomplete-placeholder-color | Placeholder color of root |
940
+ | autocomplete.invalid.placeholder.color | --p-autocomplete-invalid-placeholder-color | Invalid placeholder color of root |
941
+ | autocomplete.shadow | --p-autocomplete-shadow | Shadow of root |
942
+ | autocomplete.padding.x | --p-autocomplete-padding-x | Padding x of root |
943
+ | autocomplete.padding.y | --p-autocomplete-padding-y | Padding y of root |
944
+ | autocomplete.border.radius | --p-autocomplete-border-radius | Border radius of root |
945
+ | autocomplete.focus.ring.width | --p-autocomplete-focus-ring-width | Focus ring width of root |
946
+ | autocomplete.focus.ring.style | --p-autocomplete-focus-ring-style | Focus ring style of root |
947
+ | autocomplete.focus.ring.color | --p-autocomplete-focus-ring-color | Focus ring color of root |
948
+ | autocomplete.focus.ring.offset | --p-autocomplete-focus-ring-offset | Focus ring offset of root |
949
+ | autocomplete.focus.ring.shadow | --p-autocomplete-focus-ring-shadow | Focus ring shadow of root |
950
+ | autocomplete.transition.duration | --p-autocomplete-transition-duration | Transition duration of root |
951
+ | autocomplete.overlay.background | --p-autocomplete-overlay-background | Background of overlay |
952
+ | autocomplete.overlay.border.color | --p-autocomplete-overlay-border-color | Border color of overlay |
953
+ | autocomplete.overlay.border.radius | --p-autocomplete-overlay-border-radius | Border radius of overlay |
954
+ | autocomplete.overlay.color | --p-autocomplete-overlay-color | Color of overlay |
955
+ | autocomplete.overlay.shadow | --p-autocomplete-overlay-shadow | Shadow of overlay |
956
+ | autocomplete.list.padding | --p-autocomplete-list-padding | Padding of list |
957
+ | autocomplete.list.gap | --p-autocomplete-list-gap | Gap of list |
958
+ | autocomplete.option.focus.background | --p-autocomplete-option-focus-background | Focus background of option |
959
+ | autocomplete.option.selected.background | --p-autocomplete-option-selected-background | Selected background of option |
960
+ | autocomplete.option.selected.focus.background | --p-autocomplete-option-selected-focus-background | Selected focus background of option |
961
+ | autocomplete.option.color | --p-autocomplete-option-color | Color of option |
962
+ | autocomplete.option.focus.color | --p-autocomplete-option-focus-color | Focus color of option |
963
+ | autocomplete.option.selected.color | --p-autocomplete-option-selected-color | Selected color of option |
964
+ | autocomplete.option.selected.focus.color | --p-autocomplete-option-selected-focus-color | Selected focus color of option |
965
+ | autocomplete.option.padding | --p-autocomplete-option-padding | Padding of option |
966
+ | autocomplete.option.border.radius | --p-autocomplete-option-border-radius | Border radius of option |
967
+ | autocomplete.option.font.weight | --p-autocomplete-option-font-weight | Font weight of option |
968
+ | autocomplete.option.font.size | --p-autocomplete-option-font-size | Font size of option |
969
+ | autocomplete.option.group.background | --p-autocomplete-option-group-background | Background of option group |
970
+ | autocomplete.option.group.color | --p-autocomplete-option-group-color | Color of option group |
971
+ | autocomplete.option.group.font.weight | --p-autocomplete-option-group-font-weight | Font weight of option group |
972
+ | autocomplete.option.group.font.size | --p-autocomplete-option-group-font-size | Font size of option group |
973
+ | autocomplete.option.group.padding | --p-autocomplete-option-group-padding | Padding of option group |
974
+ | autocomplete.dropdown.width | --p-autocomplete-dropdown-width | Width of dropdown |
975
+ | autocomplete.dropdown.sm.width | --p-autocomplete-dropdown-sm-width | Sm width of dropdown |
976
+ | autocomplete.dropdown.lg.width | --p-autocomplete-dropdown-lg-width | Lg width of dropdown |
977
+ | autocomplete.dropdown.border.color | --p-autocomplete-dropdown-border-color | Border color of dropdown |
978
+ | autocomplete.dropdown.hover.border.color | --p-autocomplete-dropdown-hover-border-color | Hover border color of dropdown |
979
+ | autocomplete.dropdown.active.border.color | --p-autocomplete-dropdown-active-border-color | Active border color of dropdown |
980
+ | autocomplete.dropdown.border.radius | --p-autocomplete-dropdown-border-radius | Border radius of dropdown |
981
+ | autocomplete.dropdown.focus.ring.width | --p-autocomplete-dropdown-focus-ring-width | Focus ring width of dropdown |
982
+ | autocomplete.dropdown.focus.ring.style | --p-autocomplete-dropdown-focus-ring-style | Focus ring style of dropdown |
983
+ | autocomplete.dropdown.focus.ring.color | --p-autocomplete-dropdown-focus-ring-color | Focus ring color of dropdown |
984
+ | autocomplete.dropdown.focus.ring.offset | --p-autocomplete-dropdown-focus-ring-offset | Focus ring offset of dropdown |
985
+ | autocomplete.dropdown.focus.ring.shadow | --p-autocomplete-dropdown-focus-ring-shadow | Focus ring shadow of dropdown |
986
+ | autocomplete.dropdown.background | --p-autocomplete-dropdown-background | Background of dropdown |
987
+ | autocomplete.dropdown.hover.background | --p-autocomplete-dropdown-hover-background | Hover background of dropdown |
988
+ | autocomplete.dropdown.active.background | --p-autocomplete-dropdown-active-background | Active background of dropdown |
989
+ | autocomplete.dropdown.color | --p-autocomplete-dropdown-color | Color of dropdown |
990
+ | autocomplete.dropdown.hover.color | --p-autocomplete-dropdown-hover-color | Hover color of dropdown |
991
+ | autocomplete.dropdown.active.color | --p-autocomplete-dropdown-active-color | Active color of dropdown |
992
+ | autocomplete.chip.border.radius | --p-autocomplete-chip-border-radius | Border radius of chip |
993
+ | autocomplete.chip.focus.background | --p-autocomplete-chip-focus-background | Focus background of chip |
994
+ | autocomplete.chip.focus.color | --p-autocomplete-chip-focus-color | Focus color of chip |
995
+ | autocomplete.empty.message.padding | --p-autocomplete-empty-message-padding | Padding of empty message |