@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,563 @@
1
+ # MegaMenu
2
+
3
+ MegaMenu is navigation component that displays submenus together.
4
+
5
+ ## Basic
6
+
7
+ MegaMenu requires a collection of menuitems as its model .
8
+
9
+ ```vue
10
+ <template>
11
+ <MegaMenu :model="items" />
12
+ </template>
13
+
14
+ <script setup>
15
+ import { ref } from "vue";
16
+ import Box from '@primeicons/vue/box';
17
+ import Clock from '@primeicons/vue/clock';
18
+ import Mobile from '@primeicons/vue/mobile';
19
+
20
+ const items = ref([
21
+ {
22
+ label: 'Furniture',
23
+ icon: Box,
24
+ items: [
25
+ [
26
+ {
27
+ label: 'Living Room',
28
+ items: [{ label: 'Accessories' }, { label: 'Armchair' }, { label: 'Coffee Table' }, { label: 'Couch' }, { label: 'TV Stand' }]
29
+ }
30
+ ],
31
+ [
32
+ {
33
+ label: 'Kitchen',
34
+ items: [{ label: 'Bar stool' }, { label: 'Chair' }, { label: 'Table' }]
35
+ },
36
+ {
37
+ label: 'Bathroom',
38
+ items: [{ label: 'Accessories' }]
39
+ }
40
+ ],
41
+ [
42
+ {
43
+ label: 'Bedroom',
44
+ items: [{ label: 'Bed' }, { label: 'Chaise lounge' }, { label: 'Cupboard' }, { label: 'Dresser' }, { label: 'Wardrobe' }]
45
+ }
46
+ ],
47
+ [
48
+ {
49
+ label: 'Office',
50
+ items: [{ label: 'Bookcase' }, { label: 'Cabinet' }, { label: 'Chair' }, { label: 'Desk' }, { label: 'Executive Chair' }]
51
+ }
52
+ ]
53
+ ]
54
+ },
55
+ {
56
+ label: 'Electronics',
57
+ icon: Mobile,
58
+ items: [
59
+ [
60
+ {
61
+ label: 'Computer',
62
+ items: [{ label: 'Monitor' }, { label: 'Mouse' }, { label: 'Notebook' }, { label: 'Keyboard' }, { label: 'Printer' }, { label: 'Storage' }]
63
+ }
64
+ ],
65
+ [
66
+ {
67
+ label: 'Home Theater',
68
+ items: [{ label: 'Projector' }, { label: 'Speakers' }, { label: 'TVs' }]
69
+ }
70
+ ],
71
+ [
72
+ {
73
+ label: 'Gaming',
74
+ items: [{ label: 'Accessories' }, { label: 'Console' }, { label: 'PC' }, { label: 'Video Games' }]
75
+ }
76
+ ],
77
+ [
78
+ {
79
+ label: 'Appliances',
80
+ items: [{ label: 'Coffee Machine' }, { label: 'Fridge' }, { label: 'Oven' }, { label: 'Vaccum Cleaner' }, { label: 'Washing Machine' }]
81
+ }
82
+ ]
83
+ ]
84
+ },
85
+ {
86
+ label: 'Sports',
87
+ icon: Clock,
88
+ items: [
89
+ [
90
+ {
91
+ label: 'Football',
92
+ items: [{ label: 'Kits' }, { label: 'Shoes' }, { label: 'Shorts' }, { label: 'Training' }]
93
+ }
94
+ ],
95
+ [
96
+ {
97
+ label: 'Running',
98
+ items: [{ label: 'Accessories' }, { label: 'Shoes' }, { label: 'T-Shirts' }, { label: 'Shorts' }]
99
+ }
100
+ ],
101
+ [
102
+ {
103
+ label: 'Swimming',
104
+ items: [{ label: 'Kickboard' }, { label: 'Nose Clip' }, { label: 'Swimsuits' }, { label: 'Paddles' }]
105
+ }
106
+ ],
107
+ [
108
+ {
109
+ label: 'Tennis',
110
+ items: [{ label: 'Balls' }, { label: 'Rackets' }, { label: 'Shoes' }, { label: 'Training' }]
111
+ }
112
+ ]
113
+ ]
114
+ }
115
+ ]);
116
+ <\/script>
117
+ ```
118
+
119
+ ## Vertical
120
+
121
+ Layout of the MegaMenu is changed with the orientation property that accepts horizontal and vertical as options.
122
+
123
+ ```vue
124
+ <template>
125
+ <div>
126
+ <MegaMenu :model="items" orientation="vertical" />
127
+ </div>
128
+ </template>
129
+
130
+ <script setup>
131
+ import { ref } from "vue";
132
+ import Box from '@primeicons/vue/box';
133
+ import Clock from '@primeicons/vue/clock';
134
+ import Mobile from '@primeicons/vue/mobile';
135
+
136
+ const items = ref([
137
+ {
138
+ label: 'Furniture',
139
+ icon: Box,
140
+ items: [
141
+ [
142
+ {
143
+ label: 'Living Room',
144
+ items: [{ label: 'Accessories' }, { label: 'Armchair' }, { label: 'Coffee Table' }, { label: 'Couch' }, { label: 'TV Stand' }]
145
+ }
146
+ ],
147
+ [
148
+ {
149
+ label: 'Kitchen',
150
+ items: [{ label: 'Bar stool' }, { label: 'Chair' }, { label: 'Table' }]
151
+ },
152
+ {
153
+ label: 'Bathroom',
154
+ items: [{ label: 'Accessories' }]
155
+ }
156
+ ],
157
+ [
158
+ {
159
+ label: 'Bedroom',
160
+ items: [{ label: 'Bed' }, { label: 'Chaise lounge' }, { label: 'Cupboard' }, { label: 'Dresser' }, { label: 'Wardrobe' }]
161
+ }
162
+ ],
163
+ [
164
+ {
165
+ label: 'Office',
166
+ items: [{ label: 'Bookcase' }, { label: 'Cabinet' }, { label: 'Chair' }, { label: 'Desk' }, { label: 'Executive Chair' }]
167
+ }
168
+ ]
169
+ ]
170
+ },
171
+ {
172
+ label: 'Electronics',
173
+ icon: Mobile,
174
+ items: [
175
+ [
176
+ {
177
+ label: 'Computer',
178
+ items: [{ label: 'Monitor' }, { label: 'Mouse' }, { label: 'Notebook' }, { label: 'Keyboard' }, { label: 'Printer' }, { label: 'Storage' }]
179
+ }
180
+ ],
181
+ [
182
+ {
183
+ label: 'Home Theater',
184
+ items: [{ label: 'Projector' }, { label: 'Speakers' }, { label: 'TVs' }]
185
+ }
186
+ ],
187
+ [
188
+ {
189
+ label: 'Gaming',
190
+ items: [{ label: 'Accessories' }, { label: 'Console' }, { label: 'PC' }, { label: 'Video Games' }]
191
+ }
192
+ ],
193
+ [
194
+ {
195
+ label: 'Appliances',
196
+ items: [{ label: 'Coffee Machine' }, { label: 'Fridge' }, { label: 'Oven' }, { label: 'Vaccum Cleaner' }, { label: 'Washing Machine' }]
197
+ }
198
+ ]
199
+ ]
200
+ },
201
+ {
202
+ label: 'Sports',
203
+ icon: Clock,
204
+ items: [
205
+ [
206
+ {
207
+ label: 'Football',
208
+ items: [{ label: 'Kits' }, { label: 'Shoes' }, { label: 'Shorts' }, { label: 'Training' }]
209
+ }
210
+ ],
211
+ [
212
+ {
213
+ label: 'Running',
214
+ items: [{ label: 'Accessories' }, { label: 'Shoes' }, { label: 'T-Shirts' }, { label: 'Shorts' }]
215
+ }
216
+ ],
217
+ [
218
+ {
219
+ label: 'Swimming',
220
+ items: [{ label: 'Kickboard' }, { label: 'Nose Clip' }, { label: 'Swimsuits' }, { label: 'Paddles' }]
221
+ }
222
+ ],
223
+ [
224
+ {
225
+ label: 'Tennis',
226
+ items: [{ label: 'Balls' }, { label: 'Rackets' }, { label: 'Shoes' }, { label: 'Training' }]
227
+ }
228
+ ]
229
+ ]
230
+ }
231
+ ]);
232
+ <\/script>
233
+ ```
234
+
235
+ ## Template
236
+
237
+ Custom content can be placed inside the MegaMenu using templating. MegaMenu should be horizontal for custom content.
238
+
239
+ ```vue
240
+ <template>
241
+ <div>
242
+ <MegaMenu :model="items" class="p-3 bg-surface-0 dark:bg-surface-900" style="border-radius: 3rem; display: flex">
243
+ <template #start>
244
+ <svg width="35" height="40" viewBox="0 0 35 40" fill="none" xmlns="http://www.w3.org/2000/svg" class="h-8">
245
+ <path
246
+ d="M25.87 18.05L23.16 17.45L25.27 20.46V29.78L32.49 23.76V13.53L29.18 14.73L25.87 18.04V18.05ZM25.27 35.49L29.18 31.58V27.67L25.27 30.98V35.49ZM20.16 17.14H20.03H20.17H20.16ZM30.1 5.19L34.89 4.81L33.08 12.33L24.1 15.67L30.08 5.2L30.1 5.19ZM5.72 14.74L2.41 13.54V23.77L9.63 29.79V20.47L11.74 17.46L9.03 18.06L5.72 14.75V14.74ZM9.63 30.98L5.72 27.67V31.58L9.63 35.49V30.98ZM4.8 5.2L10.78 15.67L1.81 12.33L0 4.81L4.79 5.19L4.8 5.2ZM24.37 21.05V34.59L22.56 37.29L20.46 39.4H14.44L12.34 37.29L10.53 34.59V21.05L12.42 18.23L17.45 26.8L22.48 18.23L24.37 21.05ZM22.85 0L22.57 0.69L17.45 13.08L12.33 0.69L12.05 0H22.85Z"
247
+ fill="var(--p-primary-color)"
248
+ />
249
+ <path
250
+ d="M30.69 4.21L24.37 4.81L22.57 0.69L22.86 0H26.48L30.69 4.21ZM23.75 5.67L22.66 3.08L18.05 14.24V17.14H19.7H20.03H20.16H20.2L24.1 15.7L30.11 5.19L23.75 5.67ZM4.21002 4.21L10.53 4.81L12.33 0.69L12.05 0H8.43002L4.22002 4.21H4.21002ZM21.9 17.4L20.6 18.2H14.3L13 17.4L12.4 18.2L12.42 18.23L17.45 26.8L22.48 18.23L22.5 18.2L21.9 17.4ZM4.79002 5.19L10.8 15.7L14.7 17.14H14.74H15.2H16.85V14.24L12.24 3.09L11.15 5.68L4.79002 5.2V5.19Z"
251
+ fill="var(--p-text-color)"
252
+ />
253
+ </svg>
254
+ </template>
255
+ <template #item="{ item, icon, label }">
256
+ <a v-if="item.root" v-ripple class="flex items-center cursor-pointer px-3 py-2 overflow-hidden relative font-semibold uppercase" style="border-radius: 2rem">
257
+ <component :is="icon" />
258
+ <span class="ml-2">{{ label }}</span>
259
+ </a>
260
+ <a v-else-if="!item.image" class="flex items-center p-3 cursor-pointer mb-2 gap-2">
261
+ <span class="inline-flex items-center justify-center rounded-full bg-primary text-primary-contrast w-12 h-12">
262
+ <component :is="icon" />
263
+ </span>
264
+ <span class="inline-flex flex-col gap-1">
265
+ <span class="font-medium text-surface-900 dark:text-surface-0">{{ label }}</span>
266
+ <span class="whitespace-nowrap text-sm">{{ item.subtext }}</span>
267
+ </span>
268
+ </a>
269
+ <div v-else class="flex flex-col items-start gap-4">
270
+ <img alt="megamenu-demo" :src="item.image" class="w-full" />
271
+ <span class="text-sm">{{ item.subtext }}</span>
272
+ <Button variant="outlined">{{ label }}</Button>
273
+ </div>
274
+ </template>
275
+ <template #end>
276
+ <Avatar image="https://primefaces.org/cdn/primevue/images/avatar/amyelsner.png" shape="circle" />
277
+ </template>
278
+ </MegaMenu>
279
+ </div>
280
+ </template>
281
+
282
+ <script setup>
283
+ import { ref } from "vue";
284
+ import Comments from '@primeicons/vue/comments';
285
+ import File from '@primeicons/vue/file';
286
+ import Globe from '@primeicons/vue/globe';
287
+ import List from '@primeicons/vue/list';
288
+ import Question from '@primeicons/vue/question';
289
+ import Search from '@primeicons/vue/search';
290
+ import Shield from '@primeicons/vue/shield';
291
+ import Star from '@primeicons/vue/star';
292
+ import Users from '@primeicons/vue/users';
293
+
294
+ const items = ref([
295
+ {
296
+ label: 'Company',
297
+ root: true,
298
+ items: [
299
+ [
300
+ {
301
+ items: [
302
+ { label: 'Features', icon: List, subtext: 'Subtext of item' },
303
+ { label: 'Customers', icon: Users, subtext: 'Subtext of item' },
304
+ { label: 'Case Studies', icon: File, subtext: 'Subtext of item' }
305
+ ]
306
+ }
307
+ ],
308
+ [
309
+ {
310
+ items: [
311
+ { label: 'Solutions', icon: Shield, subtext: 'Subtext of item' },
312
+ { label: 'Faq', icon: Question, subtext: 'Subtext of item' },
313
+ { label: 'Library', icon: Search, subtext: 'Subtext of item' }
314
+ ]
315
+ }
316
+ ],
317
+ [
318
+ {
319
+ items: [
320
+ { label: 'Community', icon: Comments, subtext: 'Subtext of item' },
321
+ { label: 'Rewards', icon: Star, subtext: 'Subtext of item' },
322
+ { label: 'Investors', icon: Globe, subtext: 'Subtext of item' }
323
+ ]
324
+ }
325
+ ],
326
+ [
327
+ {
328
+ items: [{ image: 'https://primefaces.org/cdn/primevue/images/uikit/uikit-system.png', label: 'GET STARTED', subtext: 'Build spectacular apps in no time.' }]
329
+ }
330
+ ]
331
+ ]
332
+ },
333
+ {
334
+ label: 'Resources',
335
+ root: true
336
+ },
337
+ {
338
+ label: 'Contact',
339
+ root: true
340
+ }
341
+ ]);
342
+ <\/script>
343
+ ```
344
+
345
+ ## Command
346
+
347
+ The command property of a menuitem defines the callback to run when an item is activated by click or a key event.
348
+
349
+ ```vue
350
+ {
351
+ label: 'Log out',
352
+ icon: SignOut,
353
+ command: () => {
354
+ // Callback to run
355
+ }
356
+ }
357
+ ```
358
+
359
+ ## Router
360
+
361
+ Menu items support navigation via router-link, programmatic routing using commands, or external URLs.
362
+
363
+ ```vue
364
+ <template>
365
+ <MegaMenu :model="items">
366
+ <template #item="{ item, icon, label }">
367
+ <router-link v-if="item.route" v-slot="{ href, navigate }" :to="item.route" custom>
368
+ <a v-ripple :href="href" @click="navigate">
369
+ <component :is="icon" v-if="icon" />
370
+ <span class="ml-2">{{ label }}</span>
371
+ </a>
372
+ </router-link>
373
+ <a v-else v-ripple :href="item.url" :target="item.target">
374
+ <component :is="icon" v-if="icon" />
375
+ <span class="ml-2">{{ label }}</span>
376
+ </a>
377
+ </template>
378
+ </MegaMenu>
379
+ </template>
380
+
381
+ <script setup>
382
+ import { ref } from 'vue';
383
+ import { useRouter } from 'vue-router';
384
+ import Home from '@primeicons/vue/home';
385
+ import Link from '@primeicons/vue/link';
386
+ import Palette from '@primeicons/vue/palette';
387
+
388
+ const router = useRouter();
389
+
390
+ const items = ref([
391
+ {
392
+ label: 'Router',
393
+ icon: Palette,
394
+ items: [
395
+ [
396
+ {
397
+ label: 'Router Link',
398
+ items: [
399
+ { label: 'Theming', route: '/theming' },
400
+ { label: 'UI Kit', route: '/uikit' }
401
+ ]
402
+ }
403
+ ]
404
+ ]
405
+ },
406
+ {
407
+ label: 'Programmatic',
408
+ icon: Link,
409
+ command: () => {
410
+ router.push('/installation');
411
+ }
412
+ },
413
+ {
414
+ label: 'External',
415
+ icon: Home,
416
+ items: [
417
+ [
418
+ {
419
+ label: 'External',
420
+ items: [
421
+ { label: 'Vue', url: 'https://vuejs.org/', target: '_blank' },
422
+ { label: 'Vite.js', url: 'https://vitejs.dev/', target: '_blank' }
423
+ ]
424
+ }
425
+ ]
426
+ ]
427
+ }
428
+ ]);
429
+ <\/script>
430
+ ```
431
+
432
+ ## Accessibility
433
+
434
+ Screen Reader MegaMenu component uses the menubar role along with aria-orientation and the value to describe the component can either be provided with aria-labelledby or aria-label props. Each list item has a presentation role whereas anchor elements have a menuitem role with aria-label referring to the label of the item and aria-disabled defined if the item is disabled. A submenu within a MegaMenu uses the menu role with an aria-labelledby defined as the id of the submenu root menuitem label. In addition, root menuitems that open a submenu have aria-haspopup , aria-expanded and aria-controls to define the relation between the item and the submenu. Keyboard Support Key Function tab Add focus to the first item if focus moves in to the menu. If the focus is already within the menu, focus moves to the next focusable item in the page tab sequence. shift + tab Add focus to the last item if focus moves in to the menu. If the focus is already within the menu, focus moves to the previous focusable item in the page tab sequence. enter If menuitem has a submenu, toggles the visibility of the submenu otherwise activates the menuitem and closes all open overlays. space If menuitem has a submenu, toggles the visibility of the submenu otherwise activates the menuitem and closes all open overlays. escape If focus is inside a popup submenu, closes the submenu and moves focus to the root item of the closed submenu. down arrow If focus is on a root element, open a submenu and moves focus to the first element in the submenu otherwise moves focus to the next menuitem within the submenu. up arrow If focus is on a root element, opens a submenu and moves focus to the last element in the submenu otherwise moves focus to the previous menuitem within the submenu. right arrow If focus is on a root element, moves focus to the next menuitem. If the focus in inside a submenu, moves focus to the first menuitem of the next menu group. left arrow If focus is on a root element, moves focus to the previous menuitem. If the focus in inside a submenu, moves focus to the first menuitem of the previous menu group. home Moves focus to the first menuitem within the submenu. end Moves focus to the last menuitem within the submenu.
435
+
436
+ ## Mega Menu API
437
+
438
+ ### Props
439
+
440
+ | Name |Type |Default |Description |
441
+ | --- | --- | --- | --- |
442
+ | model | MenuItem[] | - | An array of menuitems. |
443
+ | orientation | HintedString<"horizontal" \| "vertical"> | horizontal | Defines the orientation. |
444
+ | breakpoint | string | 960px | The breakpoint to define the maximum width boundary. |
445
+ | disabled | boolean | false | When present, it specifies that the component should be disabled. |
446
+ | tabindex | string \| number | - | Index of the element in tabbing order. |
447
+ | scrollHeight | string | 20rem | Height of the viewport, a scrollbar is defined if height of list exceeds this value. |
448
+ | ariaLabel | string | - | Defines a string value that labels an interactive element. |
449
+ | ariaLabelledby | string | - | Identifier of the underlying menu element. |
450
+ | dt | any | - | It generates scoped CSS variables using design tokens for the component. |
451
+ | pt | PassThrough<MegaMenuPassThroughOptions> | - | Used to pass attributes to DOM elements inside the component. |
452
+ | ptOptions | any | - | Used to configure passthrough(pt) options of the component. |
453
+ | unstyled | boolean | false | When enabled, it removes component related styles in the core. |
454
+
455
+ ### Pass Through Options
456
+
457
+ | Name |Type |Description |
458
+ | --- | --- | --- |
459
+ | root | MegaMenuPassThroughOptionType | Used to pass attributes to the root's DOM element. |
460
+ | rootList | MegaMenuPassThroughOptionType | Used to pass attributes to the root list's DOM element. |
461
+ | item | MegaMenuPassThroughOptionType | Used to pass attributes to the item's DOM element. |
462
+ | itemContent | MegaMenuPassThroughOptionType | Used to pass attributes to the item content's DOM element. |
463
+ | itemLink | MegaMenuPassThroughOptionType | Used to pass attributes to the item link's DOM element. |
464
+ | itemIcon | MegaMenuPassThroughOptionType | Used to pass attributes to the item icon's DOM element. |
465
+ | itemLabel | MegaMenuPassThroughOptionType | Used to pass attributes to the item label's DOM element. |
466
+ | submenuIcon | MegaMenuPassThroughOptionType | Used to pass attributes to the submenu icon's DOM element. |
467
+ | overlay | MegaMenuPassThroughOptionType | Used to pass attributes to the overlay DOM element. |
468
+ | grid | MegaMenuPassThroughOptionType | Used to pass attributes to the grid's DOM element. |
469
+ | column | MegaMenuPassThroughOptionType | Used to pass attributes to the column's DOM element. |
470
+ | submenuLabel | MegaMenuPassThroughOptionType | Used to pass attributes to the submenu item's DOM element. |
471
+ | submenu | MegaMenuPassThroughOptionType | Used to pass attributes to the submenu's DOM element. |
472
+ | separator | MegaMenuPassThroughOptionType | Used to pass attributes to the separator's DOM element. |
473
+ | button | MegaMenuPassThroughOptionType | Used to pass attributes to the mobile popup menu button's DOM element. |
474
+ | buttonIcon | MegaMenuPassThroughOptionType | Used to pass attributes to the mobile popup menu button icon's DOM element. |
475
+ | start | MegaMenuPassThroughOptionType | Used to pass attributes to the start of the component. |
476
+ | end | MegaMenuPassThroughOptionType | Used to pass attributes to the end of the component. |
477
+ | hooks | any | Used to manage all lifecycle hooks. |
478
+
479
+ ### Theming
480
+
481
+ ### CSS Classes
482
+
483
+ | Class |Description |
484
+ | --- | --- |
485
+ | p-megamenu | Class name of the root element |
486
+ | p-megamenu-start | Class name of the start element |
487
+ | p-megamenu-button | Class name of the button element |
488
+ | p-megamenu-root-list | Class name of the root list element |
489
+ | p-megamenu-submenu-item | Class name of the submenu item element |
490
+ | p-megamenu-item | Class name of the item element |
491
+ | p-megamenu-item-content | Class name of the item content element |
492
+ | p-megamenu-item-link | Class name of the item link element |
493
+ | p-megamenu-item-icon | Class name of the item icon element |
494
+ | p-megamenu-item-label | Class name of the item label element |
495
+ | p-megamenu-submenu-icon | Class name of the submenu icon element |
496
+ | p-megamenu-panel | Class name of the panel element |
497
+ | p-megamenu-grid | Class name of the grid element |
498
+ | p-megamenu-submenu | Class name of the submenu element |
499
+ | p-megamenu-submenu-item-label | Class name of the submenu item label element |
500
+ | p-megamenu-separator | Class name of the separator element |
501
+ | p-megamenu-end | Class name of the end element |
502
+
503
+ ### Design Tokens
504
+
505
+ | Token |CSS Variable |Description |
506
+ | --- | --- | --- |
507
+ | megamenu.background | --p-megamenu-background | Background of root |
508
+ | megamenu.border.color | --p-megamenu-border-color | Border color of root |
509
+ | megamenu.border.radius | --p-megamenu-border-radius | Border radius of root |
510
+ | megamenu.color | --p-megamenu-color | Color of root |
511
+ | megamenu.gap | --p-megamenu-gap | Gap of root |
512
+ | megamenu.vertical.orientation.padding | --p-megamenu-vertical-orientation-padding | Vertical orientation padding of root |
513
+ | megamenu.vertical.orientation.gap | --p-megamenu-vertical-orientation-gap | Vertical orientation gap of root |
514
+ | megamenu.horizontal.orientation.padding | --p-megamenu-horizontal-orientation-padding | Horizontal orientation padding of root |
515
+ | megamenu.horizontal.orientation.gap | --p-megamenu-horizontal-orientation-gap | Horizontal orientation gap of root |
516
+ | megamenu.transition.duration | --p-megamenu-transition-duration | Transition duration of root |
517
+ | megamenu.base.item.border.radius | --p-megamenu-base-item-border-radius | Border radius of base item |
518
+ | megamenu.base.item.padding | --p-megamenu-base-item-padding | Padding of base item |
519
+ | megamenu.item.focus.background | --p-megamenu-item-focus-background | Focus background of item |
520
+ | megamenu.item.active.background | --p-megamenu-item-active-background | Active background of item |
521
+ | megamenu.item.color | --p-megamenu-item-color | Color of item |
522
+ | megamenu.item.focus.color | --p-megamenu-item-focus-color | Focus color of item |
523
+ | megamenu.item.active.color | --p-megamenu-item-active-color | Active color of item |
524
+ | megamenu.item.padding | --p-megamenu-item-padding | Padding of item |
525
+ | megamenu.item.border.radius | --p-megamenu-item-border-radius | Border radius of item |
526
+ | megamenu.item.gap | --p-megamenu-item-gap | Gap of item |
527
+ | megamenu.item.icon.color | --p-megamenu-item-icon-color | Icon color of item |
528
+ | megamenu.item.icon.focus.color | --p-megamenu-item-icon-focus-color | Icon focus color of item |
529
+ | megamenu.item.icon.active.color | --p-megamenu-item-icon-active-color | Icon active color of item |
530
+ | megamenu.item.icon.size | --p-megamenu-item-icon-size | Icon size of item |
531
+ | megamenu.item.label.font.weight | --p-megamenu-item-label-font-weight | Font weight of item label |
532
+ | megamenu.item.label.font.size | --p-megamenu-item-label-font-size | Font size of item label |
533
+ | megamenu.overlay.padding | --p-megamenu-overlay-padding | Padding of overlay |
534
+ | megamenu.overlay.background | --p-megamenu-overlay-background | Background of overlay |
535
+ | megamenu.overlay.border.color | --p-megamenu-overlay-border-color | Border color of overlay |
536
+ | megamenu.overlay.border.radius | --p-megamenu-overlay-border-radius | Border radius of overlay |
537
+ | megamenu.overlay.color | --p-megamenu-overlay-color | Color of overlay |
538
+ | megamenu.overlay.shadow | --p-megamenu-overlay-shadow | Shadow of overlay |
539
+ | megamenu.overlay.gap | --p-megamenu-overlay-gap | Gap of overlay |
540
+ | megamenu.submenu.padding | --p-megamenu-submenu-padding | Padding of submenu |
541
+ | megamenu.submenu.gap | --p-megamenu-submenu-gap | Gap of submenu |
542
+ | megamenu.submenu.label.padding | --p-megamenu-submenu-label-padding | Padding of submenu label |
543
+ | megamenu.submenu.label.font.weight | --p-megamenu-submenu-label-font-weight | Font weight of submenu label |
544
+ | megamenu.submenu.label.font.size | --p-megamenu-submenu-label-font-size | Font size of submenu label |
545
+ | megamenu.submenu.label.background | --p-megamenu-submenu-label-background | Background of submenu label |
546
+ | megamenu.submenu.label.color | --p-megamenu-submenu-label-color | Color of submenu label |
547
+ | megamenu.submenu.icon.size | --p-megamenu-submenu-icon-size | Size of submenu icon |
548
+ | megamenu.submenu.icon.color | --p-megamenu-submenu-icon-color | Color of submenu icon |
549
+ | megamenu.submenu.icon.focus.color | --p-megamenu-submenu-icon-focus-color | Focus color of submenu icon |
550
+ | megamenu.submenu.icon.active.color | --p-megamenu-submenu-icon-active-color | Active color of submenu icon |
551
+ | megamenu.separator.border.color | --p-megamenu-separator-border-color | Border color of separator |
552
+ | megamenu.mobile.button.border.radius | --p-megamenu-mobile-button-border-radius | Border radius of mobile button |
553
+ | megamenu.mobile.button.size | --p-megamenu-mobile-button-size | Size of mobile button |
554
+ | megamenu.mobile.button.color | --p-megamenu-mobile-button-color | Color of mobile button |
555
+ | megamenu.mobile.button.hover.color | --p-megamenu-mobile-button-hover-color | Hover color of mobile button |
556
+ | megamenu.mobile.button.hover.background | --p-megamenu-mobile-button-hover-background | Hover background of mobile button |
557
+ | megamenu.mobile.button.focus.ring.width | --p-megamenu-mobile-button-focus-ring-width | Focus ring width of mobile button |
558
+ | megamenu.mobile.button.focus.ring.style | --p-megamenu-mobile-button-focus-ring-style | Focus ring style of mobile button |
559
+ | megamenu.mobile.button.focus.ring.color | --p-megamenu-mobile-button-focus-ring-color | Focus ring color of mobile button |
560
+ | megamenu.mobile.button.focus.ring.offset | --p-megamenu-mobile-button-focus-ring-offset | Focus ring offset of mobile button |
561
+ | megamenu.mobile.button.focus.ring.shadow | --p-megamenu-mobile-button-focus-ring-shadow | Focus ring shadow of mobile button |
562
+
563
+ ## Menu Item API