@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,840 @@
1
+ # SplitButton
2
+
3
+ SplitButton groups a set of commands in an overlay with a default command.
4
+
5
+ ## Basic
6
+
7
+ SplitButton has a default action button and a collection of additional options defined by the model property based on MenuModel API.
8
+
9
+ ```vue
10
+ <template>
11
+ <div class="flex justify-center">
12
+ <Toast />
13
+ <SplitButton label="Save" @click="save" :model="items" />
14
+ </div>
15
+ </template>
16
+
17
+ <script setup>
18
+ import { useToast } from "primevue/usetoast";
19
+ const toast = useToast();
20
+
21
+ const items = [
22
+ {
23
+ label: 'Update',
24
+ command: () => {
25
+ toast.add({ severity: 'success', summary: 'Updated', detail: 'Data Updated', life: 3000 });
26
+ }
27
+ },
28
+ {
29
+ label: 'Delete',
30
+ command: () => {
31
+ toast.add({ severity: 'warn', summary: 'Delete', detail: 'Data Deleted', life: 3000 });
32
+ }
33
+ },
34
+ {
35
+ label: 'Vue.js',
36
+ url: 'https://vuejs.org/'
37
+ },
38
+ {
39
+ separator: true
40
+ },
41
+ {
42
+ label: 'Upload',
43
+ route: '/fileupload'
44
+ }
45
+ ];
46
+
47
+ const save = () => {
48
+ toast.add({ severity: 'success', summary: 'Success', detail: 'Data Saved', life: 3000 });
49
+ };
50
+ <\/script>
51
+ ```
52
+
53
+ ## Icons
54
+
55
+ The buttons and menuitems have support to display icons.
56
+
57
+ ```vue
58
+ <template>
59
+ <div class="flex justify-center">
60
+ <Toast />
61
+ <SplitButton label="Save" @click="save" :model="items">
62
+ <template #icon>
63
+ <Check />
64
+ </template>
65
+ <template #dropdownicon>
66
+ <Cog />
67
+ </template>
68
+ </SplitButton>
69
+ </div>
70
+ </template>
71
+
72
+ <script setup>
73
+ import Check from '@primeicons/vue/check';
74
+ import Cog from '@primeicons/vue/cog';
75
+ import PowerOff from '@primeicons/vue/power-off';
76
+ import Refresh from '@primeicons/vue/refresh';
77
+ import Times from '@primeicons/vue/times';
78
+ import { useToast } from "primevue/usetoast";
79
+ const toast = useToast();
80
+
81
+ const items = [
82
+ {
83
+ label: 'Update',
84
+ icon: Refresh,
85
+ command: () => {
86
+ toast.add({ severity: 'success', summary: 'Updated', detail: 'Data Updated', life: 3000 });
87
+ }
88
+ },
89
+ {
90
+ label: 'Delete',
91
+ icon: Times,
92
+ command: () => {
93
+ toast.add({ severity: 'warn', summary: 'Delete', detail: 'Data Deleted', life: 3000 });
94
+ }
95
+ },
96
+ {
97
+ separator: true
98
+ },
99
+ {
100
+ label: 'Quit',
101
+ icon: PowerOff,
102
+ command: () => {
103
+ window.location.href = 'https://vuejs.org/';
104
+ }
105
+ }
106
+ ];
107
+
108
+ const save = () => {
109
+ toast.add({ severity: 'success', summary: 'Success', detail: 'Data Saved', life: 3000 });
110
+ };
111
+ <\/script>
112
+ ```
113
+
114
+ ## Nested
115
+
116
+ SplitButton has a default action button and a collection of additional options defined by the model property based on MenuModel API.
117
+
118
+ ```vue
119
+ <template>
120
+ <div class="flex justify-center">
121
+ <Toast />
122
+ <SplitButton label="Save" @click="save" :model="items" />
123
+ </div>
124
+ </template>
125
+
126
+ <script setup>
127
+ import AlignCenter from '@primeicons/vue/align-center';
128
+ import AlignJustify from '@primeicons/vue/align-justify';
129
+ import AlignLeft from '@primeicons/vue/align-left';
130
+ import AlignRight from '@primeicons/vue/align-right';
131
+ import Bars from '@primeicons/vue/bars';
132
+ import Bookmark from '@primeicons/vue/bookmark';
133
+ import Calendar from '@primeicons/vue/calendar';
134
+ import CalendarMinus from '@primeicons/vue/calendar-minus';
135
+ import CalendarPlus from '@primeicons/vue/calendar-plus';
136
+ import CalendarTimes from '@primeicons/vue/calendar-times';
137
+ import ExternalLink from '@primeicons/vue/external-link';
138
+ import File from '@primeicons/vue/file';
139
+ import Filter from '@primeicons/vue/filter';
140
+ import Pencil from '@primeicons/vue/pencil';
141
+ import Plus from '@primeicons/vue/plus';
142
+ import PowerOff from '@primeicons/vue/power-off';
143
+ import Print from '@primeicons/vue/print';
144
+ import Trash from '@primeicons/vue/trash';
145
+ import User from '@primeicons/vue/user';
146
+ import UserMinus from '@primeicons/vue/user-minus';
147
+ import UserPlus from '@primeicons/vue/user-plus';
148
+ import Users from '@primeicons/vue/users';
149
+ import Video from '@primeicons/vue/video';
150
+ import { useToast } from "primevue/usetoast";
151
+ const toast = useToast();
152
+
153
+ const items = [
154
+ {
155
+ label: 'File',
156
+ icon: File,
157
+ items: [
158
+ {
159
+ label: 'New',
160
+ icon: Plus,
161
+ items: [
162
+ {
163
+ label: 'Bookmark',
164
+ icon: Bookmark
165
+ },
166
+ {
167
+ label: 'Video',
168
+ icon: Video
169
+ }
170
+ ]
171
+ },
172
+ {
173
+ label: 'Delete',
174
+ icon: Trash
175
+ },
176
+ {
177
+ separator: true
178
+ },
179
+ {
180
+ label: 'Export',
181
+ icon: ExternalLink
182
+ }
183
+ ]
184
+ },
185
+ {
186
+ label: 'Edit',
187
+ icon: Pencil,
188
+ items: [
189
+ {
190
+ label: 'Left',
191
+ icon: AlignLeft
192
+ },
193
+ {
194
+ label: 'Right',
195
+ icon: AlignRight
196
+ },
197
+ {
198
+ label: 'Center',
199
+ icon: AlignCenter
200
+ },
201
+ {
202
+ label: 'Justify',
203
+ icon: AlignJustify
204
+ }
205
+ ]
206
+ },
207
+ {
208
+ label: 'Users',
209
+ icon: User,
210
+ items: [
211
+ {
212
+ label: 'New',
213
+ icon: UserPlus
214
+ },
215
+ {
216
+ label: 'Delete',
217
+ icon: UserMinus
218
+ },
219
+ {
220
+ label: 'Search',
221
+ icon: Users,
222
+ items: [
223
+ {
224
+ label: 'Filter',
225
+ icon: Filter,
226
+ items: [
227
+ {
228
+ label: 'Print',
229
+ icon: Print
230
+ }
231
+ ]
232
+ },
233
+ {
234
+ icon: Bars,
235
+ label: 'List'
236
+ }
237
+ ]
238
+ }
239
+ ]
240
+ },
241
+ {
242
+ label: 'Events',
243
+ icon: Calendar,
244
+ items: [
245
+ {
246
+ label: 'Edit',
247
+ icon: Pencil,
248
+ items: [
249
+ {
250
+ label: 'Save',
251
+ icon: CalendarPlus
252
+ },
253
+ {
254
+ label: 'Delete',
255
+ icon: CalendarMinus
256
+ }
257
+ ]
258
+ },
259
+ {
260
+ label: 'Archieve',
261
+ icon: CalendarTimes,
262
+ items: [
263
+ {
264
+ label: 'Remove',
265
+ icon: CalendarMinus
266
+ }
267
+ ]
268
+ }
269
+ ]
270
+ },
271
+ {
272
+ separator: true
273
+ },
274
+ {
275
+ label: 'Quit',
276
+ icon: PowerOff
277
+ }
278
+ ];
279
+
280
+ const save = () => {
281
+ toast.add({ severity: 'success', summary: 'Success', detail: 'Data Saved', life: 3000 });
282
+ };
283
+ <\/script>
284
+ ```
285
+
286
+ ## Severity
287
+
288
+ The severity property defines the variant of a button.
289
+
290
+ ```vue
291
+ <template>
292
+ <div class="flex justify-center flex-wrap gap-4">
293
+ <Toast />
294
+ <SplitButton label="Primary" :model="items" @click="save"></SplitButton>
295
+ <SplitButton label="Secondary" :model="items" @click="save" severity="secondary"></SplitButton>
296
+ <SplitButton label="Success" :model="items" @click="save" severity="success"></SplitButton>
297
+ <SplitButton label="Info" :model="items" @click="save" severity="info"></SplitButton>
298
+ <SplitButton label="Warn" :model="items" @click="save" severity="warn"></SplitButton>
299
+ <SplitButton label="Help" :model="items" @click="save" severity="help"></SplitButton>
300
+ <SplitButton label="Danger" :model="items" @click="save" severity="danger"></SplitButton>
301
+ <SplitButton label="Contrast" :model="items" @click="save" severity="contrast"></SplitButton>
302
+ </div>
303
+ </template>
304
+
305
+ <script setup>
306
+ import { useToast } from "primevue/usetoast";
307
+ const toast = useToast();
308
+
309
+ const items = [
310
+ {
311
+ label: 'Update',
312
+ command: () => {
313
+ toast.add({ severity: 'success', summary: 'Updated', detail: 'Data Updated', life: 3000 });
314
+ }
315
+ },
316
+ {
317
+ label: 'Delete',
318
+ command: () => {
319
+ toast.add({ severity: 'warn', summary: 'Delete', detail: 'Data Deleted', life: 3000 });
320
+ }
321
+ },
322
+ {
323
+ label: 'Vue.js',
324
+ url: 'https://vuejs.org/'
325
+ },
326
+ {
327
+ separator: true
328
+ },
329
+ {
330
+ label: 'Upload',
331
+ route: '/fileupload'
332
+ }
333
+ ];
334
+
335
+ const save = () => {
336
+ toast.add({ severity: 'success', summary: 'Success', detail: 'Data Saved', life: 3000 });
337
+ };
338
+ <\/script>
339
+ ```
340
+
341
+ ## Disabled
342
+
343
+ When the disabled attribute is present, the element is uneditable and unfocused.
344
+
345
+ ```vue
346
+ <template>
347
+ <div class="flex justify-center">
348
+ <Toast />
349
+ <SplitButton label="Save" @click="save" :model="items" disabled>
350
+ <template #icon>
351
+ <Plus />
352
+ </template>
353
+ </SplitButton>
354
+ </div>
355
+ </template>
356
+
357
+ <script setup>
358
+ import Plus from '@primeicons/vue/plus';
359
+ import { useToast } from "primevue/usetoast";
360
+ const toast = useToast();
361
+
362
+ const items = [
363
+ {
364
+ label: 'Update',
365
+ command: () => {
366
+ toast.add({ severity: 'success', summary: 'Updated', detail: 'Data Updated', life: 3000 });
367
+ }
368
+ },
369
+ {
370
+ label: 'Delete',
371
+ command: () => {
372
+ toast.add({ severity: 'warn', summary: 'Delete', detail: 'Data Deleted', life: 3000 });
373
+ }
374
+ },
375
+ {
376
+ label: 'Vue.js',
377
+ url: 'https://vuejs.org/'
378
+ },
379
+ {
380
+ separator: true
381
+ },
382
+ {
383
+ label: 'Upload',
384
+ route: '/fileupload'
385
+ }
386
+ ];
387
+
388
+ const save = () => {
389
+ toast.add({ severity: 'success', summary: 'Success', detail: 'Data Saved', life: 3000 });
390
+ };
391
+ <\/script>
392
+ ```
393
+
394
+ ## Raised
395
+
396
+ Raised buttons display a shadow to indicate elevation.
397
+
398
+ ```vue
399
+ <template>
400
+ <div class="flex justify-center flex-wrap gap-4">
401
+ <Toast />
402
+ <SplitButton label="Primary" :model="items" @click="save" raised></SplitButton>
403
+ <SplitButton label="Secondary" :model="items" @click="save" raised severity="secondary"></SplitButton>
404
+ <SplitButton label="Success" :model="items" @click="save" raised severity="success"></SplitButton>
405
+ <SplitButton label="Info" :model="items" @click="save" raised severity="info"></SplitButton>
406
+ <SplitButton label="Warn" :model="items" @click="save" raised severity="warn"></SplitButton>
407
+ <SplitButton label="Help" :model="items" @click="save" raised severity="help"></SplitButton>
408
+ <SplitButton label="Danger" :model="items" @click="save" raised severity="danger"></SplitButton>
409
+ <SplitButton label="Contrast" :model="items" @click="save" raised severity="contrast"></SplitButton>
410
+ </div>
411
+ </template>
412
+
413
+ <script setup>
414
+ import { useToast } from "primevue/usetoast";
415
+ const toast = useToast();
416
+
417
+ const items = [
418
+ {
419
+ label: 'Update',
420
+ command: () => {
421
+ toast.add({ severity: 'success', summary: 'Updated', detail: 'Data Updated', life: 3000 });
422
+ }
423
+ },
424
+ {
425
+ label: 'Delete',
426
+ command: () => {
427
+ toast.add({ severity: 'warn', summary: 'Delete', detail: 'Data Deleted', life: 3000 });
428
+ }
429
+ },
430
+ {
431
+ label: 'Vue.js',
432
+ url: 'https://vuejs.org/'
433
+ },
434
+ {
435
+ separator: true
436
+ },
437
+ {
438
+ label: 'Upload',
439
+ route: '/fileupload'
440
+ }
441
+ ];
442
+
443
+ const save = () => {
444
+ toast.add({ severity: 'success', summary: 'Success', detail: 'Data Saved', life: 3000 });
445
+ };
446
+ <\/script>
447
+ ```
448
+
449
+ ## Rounded
450
+
451
+ Rounded buttons have a circular border radius.
452
+
453
+ ```vue
454
+ <template>
455
+ <div class="flex justify-center flex-wrap gap-4">
456
+ <Toast />
457
+ <SplitButton label="Primary" :model="items" @click="save" rounded></SplitButton>
458
+ <SplitButton label="Secondary" :model="items" @click="save" rounded severity="secondary"></SplitButton>
459
+ <SplitButton label="Success" :model="items" @click="save" rounded severity="success"></SplitButton>
460
+ <SplitButton label="Info" :model="items" @click="save" rounded severity="info"></SplitButton>
461
+ <SplitButton label="Warn" :model="items" @click="save" rounded severity="warn"></SplitButton>
462
+ <SplitButton label="Help" :model="items" @click="save" rounded severity="help"></SplitButton>
463
+ <SplitButton label="Danger" :model="items" @click="save" rounded severity="danger"></SplitButton>
464
+ <SplitButton label="Contrast" :model="items" @click="save" rounded severity="contrast"></SplitButton>
465
+ </div>
466
+ </template>
467
+
468
+ <script setup>
469
+ import { useToast } from "primevue/usetoast";
470
+ const toast = useToast();
471
+
472
+ const items = [
473
+ {
474
+ label: 'Update',
475
+ command: () => {
476
+ toast.add({ severity: 'success', summary: 'Updated', detail: 'Data Updated', life: 3000 });
477
+ }
478
+ },
479
+ {
480
+ label: 'Delete',
481
+ command: () => {
482
+ toast.add({ severity: 'warn', summary: 'Delete', detail: 'Data Deleted', life: 3000 });
483
+ }
484
+ },
485
+ {
486
+ label: 'Vue.js',
487
+ url: 'https://vuejs.org/'
488
+ },
489
+ {
490
+ separator: true
491
+ },
492
+ {
493
+ label: 'Upload',
494
+ route: '/fileupload'
495
+ }
496
+ ];
497
+
498
+ const save = () => {
499
+ toast.add({ severity: 'success', summary: 'Success', detail: 'Data Saved', life: 3000 });
500
+ };
501
+ <\/script>
502
+ ```
503
+
504
+ ## Text
505
+
506
+ Text buttons are displayed as textual elements.
507
+
508
+ ```vue
509
+ <template>
510
+ <div class="flex justify-center flex-wrap gap-4">
511
+ <Toast />
512
+ <SplitButton label="Primary" :model="items" @click="save" text></SplitButton>
513
+ <SplitButton label="Secondary" :model="items" @click="save" text severity="secondary"></SplitButton>
514
+ <SplitButton label="Success" :model="items" @click="save" text severity="success"></SplitButton>
515
+ <SplitButton label="Info" :model="items" @click="save" text severity="info"></SplitButton>
516
+ <SplitButton label="Warn" :model="items" @click="save" text severity="warn"></SplitButton>
517
+ <SplitButton label="Help" :model="items" @click="save" text severity="help"></SplitButton>
518
+ <SplitButton label="Danger" :model="items" @click="save" text severity="danger"></SplitButton>
519
+ <SplitButton label="Contrast" :model="items" @click="save" text severity="contrast"></SplitButton>
520
+ </div>
521
+ </template>
522
+
523
+ <script setup>
524
+ import { useToast } from "primevue/usetoast";
525
+ const toast = useToast();
526
+
527
+ const items = [
528
+ {
529
+ label: 'Update',
530
+ command: () => {
531
+ toast.add({ severity: 'success', summary: 'Updated', detail: 'Data Updated', life: 3000 });
532
+ }
533
+ },
534
+ {
535
+ label: 'Delete',
536
+ command: () => {
537
+ toast.add({ severity: 'warn', summary: 'Delete', detail: 'Data Deleted', life: 3000 });
538
+ }
539
+ },
540
+ {
541
+ label: 'Vue.js',
542
+ url: 'https://vuejs.org/'
543
+ },
544
+ {
545
+ separator: true
546
+ },
547
+ {
548
+ label: 'Upload',
549
+ route: '/fileupload'
550
+ }
551
+ ];
552
+
553
+ const save = () => {
554
+ toast.add({ severity: 'success', summary: 'Success', detail: 'Data Saved', life: 3000 });
555
+ };
556
+ <\/script>
557
+ ```
558
+
559
+ ## Raised Text
560
+
561
+ Text buttons can be displayed as raised as well for elevation.
562
+
563
+ ```vue
564
+ <template>
565
+ <div class="flex justify-center flex-wrap gap-4">
566
+ <Toast />
567
+ <SplitButton label="Primary" :model="items" @click="save" raised text></SplitButton>
568
+ <SplitButton label="Secondary" :model="items" @click="save" raised text severity="secondary"></SplitButton>
569
+ <SplitButton label="Success" :model="items" @click="save" raised text severity="success"></SplitButton>
570
+ <SplitButton label="Info" :model="items" @click="save" raised text severity="info"></SplitButton>
571
+ <SplitButton label="Warn" :model="items" @click="save" raised text severity="warn"></SplitButton>
572
+ <SplitButton label="Help" :model="items" @click="save" raised text severity="help"></SplitButton>
573
+ <SplitButton label="Danger" :model="items" @click="save" raised text severity="danger"></SplitButton>
574
+ <SplitButton label="Contrast" :model="items" @click="save" raised text severity="contrast"></SplitButton>
575
+ </div>
576
+ </template>
577
+
578
+ <script setup>
579
+ import { useToast } from "primevue/usetoast";
580
+ const toast = useToast();
581
+
582
+ const items = [
583
+ {
584
+ label: 'Update',
585
+ command: () => {
586
+ toast.add({ severity: 'success', summary: 'Updated', detail: 'Data Updated', life: 3000 });
587
+ }
588
+ },
589
+ {
590
+ label: 'Delete',
591
+ command: () => {
592
+ toast.add({ severity: 'warn', summary: 'Delete', detail: 'Data Deleted', life: 3000 });
593
+ }
594
+ },
595
+ {
596
+ label: 'Vue.js',
597
+ url: 'https://vuejs.org/'
598
+ },
599
+ {
600
+ separator: true
601
+ },
602
+ {
603
+ label: 'Upload',
604
+ route: '/fileupload'
605
+ }
606
+ ];
607
+
608
+ const save = () => {
609
+ toast.add({ severity: 'success', summary: 'Success', detail: 'Data Saved', life: 3000 });
610
+ };
611
+ <\/script>
612
+ ```
613
+
614
+ ## Outlined
615
+
616
+ Outlined buttons display a border without a background initially.
617
+
618
+ ```vue
619
+ <template>
620
+ <div class="flex justify-center flex-wrap gap-4">
621
+ <Toast />
622
+ <SplitButton label="Primary" :model="items" @click="save" outlined></SplitButton>
623
+ <SplitButton label="Secondary" :model="items" @click="save" outlined severity="secondary"></SplitButton>
624
+ <SplitButton label="Success" :model="items" @click="save" outlined severity="success"></SplitButton>
625
+ <SplitButton label="Info" :model="items" @click="save" outlined severity="info"></SplitButton>
626
+ <SplitButton label="Warn" :model="items" @click="save" outlined severity="warn"></SplitButton>
627
+ <SplitButton label="Help" :model="items" @click="save" outlined severity="help"></SplitButton>
628
+ <SplitButton label="Danger" :model="items" @click="save" outlined severity="danger"></SplitButton>
629
+ <SplitButton label="Contrast" :model="items" @click="save" outlined severity="contrast"></SplitButton>
630
+ </div>
631
+ </template>
632
+
633
+ <script setup>
634
+ import { useToast } from "primevue/usetoast";
635
+ const toast = useToast();
636
+
637
+ const items = [
638
+ {
639
+ label: 'Update',
640
+ command: () => {
641
+ toast.add({ severity: 'success', summary: 'Updated', detail: 'Data Updated', life: 3000 });
642
+ }
643
+ },
644
+ {
645
+ label: 'Delete',
646
+ command: () => {
647
+ toast.add({ severity: 'warn', summary: 'Delete', detail: 'Data Deleted', life: 3000 });
648
+ }
649
+ },
650
+ {
651
+ label: 'Vue.js',
652
+ url: 'https://vuejs.org/'
653
+ },
654
+ {
655
+ separator: true
656
+ },
657
+ {
658
+ label: 'Upload',
659
+ route: '/fileupload'
660
+ }
661
+ ];
662
+
663
+ const save = () => {
664
+ toast.add({ severity: 'success', summary: 'Success', detail: 'Data Saved', life: 3000 });
665
+ };
666
+ <\/script>
667
+ ```
668
+
669
+ ## Sizes
670
+
671
+ SplitButton provides small and large sizes as alternatives to the standard.
672
+
673
+ ```vue
674
+ <template>
675
+ <div class="flex items-center justify-center flex-wrap gap-4">
676
+ <Toast />
677
+ <SplitButton label="Small" :model="items" @click="save" size="small"></SplitButton>
678
+ <SplitButton label="Normal" :model="items" @click="save"></SplitButton>
679
+ <SplitButton label="Large" :model="items" @click="save" size="large"></SplitButton>
680
+ </div>
681
+ </template>
682
+
683
+ <script setup>
684
+ import { useToast } from "primevue/usetoast";
685
+ const toast = useToast();
686
+
687
+ const items = [
688
+ {
689
+ label: 'Update',
690
+ command: () => {
691
+ toast.add({ severity: 'success', summary: 'Updated', detail: 'Data Updated', life: 3000 });
692
+ }
693
+ },
694
+ {
695
+ label: 'Delete',
696
+ command: () => {
697
+ toast.add({ severity: 'warn', summary: 'Delete', detail: 'Data Deleted', life: 3000 });
698
+ }
699
+ },
700
+ {
701
+ label: 'Vue.js',
702
+ url: 'https://vuejs.org/'
703
+ },
704
+ {
705
+ separator: true
706
+ },
707
+ {
708
+ label: 'Upload',
709
+ route: '/fileupload'
710
+ }
711
+ ];
712
+
713
+ const save = () => {
714
+ toast.add({ severity: 'success', summary: 'Success', detail: 'Data Saved', life: 3000 });
715
+ };
716
+ <\/script>
717
+ ```
718
+
719
+ ## Template
720
+
721
+ Custom content inside a button is defined as children.
722
+
723
+ ```vue
724
+ <template>
725
+ <div class="flex justify-center">
726
+ <Toast />
727
+ <SplitButton :model="items" @click="save" severity="contrast">
728
+ <span class="flex items-center font-bold">
729
+ <img alt="logo" src="https://primefaces.org/cdn/primevue/images/logo.svg" style="height: 1rem; margin-right: 0.5rem" />
730
+ <span>PrimeVue</span>
731
+ </span>
732
+ </SplitButton>
733
+ </div>
734
+ </template>
735
+
736
+ <script setup>
737
+ import { useToast } from "primevue/usetoast";
738
+ const toast = useToast();
739
+
740
+ const items = [
741
+ {
742
+ label: 'Update',
743
+ command: () => {
744
+ toast.add({ severity: 'success', summary: 'Updated', detail: 'Data Updated', life: 3000 });
745
+ }
746
+ },
747
+ {
748
+ label: 'Delete',
749
+ command: () => {
750
+ toast.add({ severity: 'warn', summary: 'Delete', detail: 'Data Deleted', life: 3000 });
751
+ }
752
+ },
753
+ {
754
+ label: 'Vue.js',
755
+ url: 'https://vuejs.org/'
756
+ },
757
+ {
758
+ separator: true
759
+ },
760
+ {
761
+ label: 'Upload',
762
+ route: '/fileupload'
763
+ }
764
+ ];
765
+
766
+ const save = () => {
767
+ toast.add({ severity: 'success', summary: 'Success', detail: 'Data Saved', life: 3000 });
768
+ };
769
+ <\/script>
770
+ ```
771
+
772
+ ## Accessibility
773
+
774
+ Screen Reader SplitButton component renders two native button elements, main button uses the label property to define aria-label by default which can be customized with buttonProps . Dropdown button requires an explicit definition to describe it using menuButtonProps option and also includes aria-haspopup , aria-expanded for states along with aria-controls to define the relation between the popup and the button. The popup overlay uses menu role on the list and each action item has a menuitem role with an aria-label as the menuitem label. The id of the menu refers to the aria-controls of the dropdown button. Main Button Keyboard Support Key Function enter Activates the button. space Activates the button. Menu Button Keyboard Support Key Function enter space down arrow up arrow Opens the menu and moves focus to the first item. Menu Keyboard Support Key Function enter If menuitem has a submenu, opens the submenu otherwise activates the menuitem and closes all open overlays. space If menuitem has a submenu, opens 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 Moves focus to the next menuitem within the submenu. up arrow Moves focus to the previous menuitem within the submenu. alt + up arrow Closes the popup, then moves focus to the target element. right arrow In nested mode if option is closed, opens the option otherwise moves focus to the first child option. left arrow In nested mode if option is open, closes the option otherwise moves focus to the parent option. home Moves focus to the first menuitem within the submenu. end Moves focus to the last menuitem within the submenu. any printable character Moves focus to the menuitem whose label starts with the characters being typed.
775
+
776
+ ```vue
777
+ <template>
778
+ <SplitButton :buttonProps="{'aria-label': 'Default Action'}" :menuButtonProps="{'aria-label': 'More Options'}" />
779
+ </template>
780
+ ```
781
+
782
+ ## Split Button API
783
+
784
+ ### Props
785
+
786
+ | Name |Type |Default |Description |
787
+ | --- | --- | --- | --- |
788
+ | label | string | - | Text of the button. |
789
+ | icon | string | - | Name of the icon. |
790
+ | model | MenuItem[] | - | MenuModel instance to define the overlay items. |
791
+ | autoZIndex | boolean | true | Whether to automatically manage layering. |
792
+ | baseZIndex | number | 0 | Base zIndex value to use in layering. |
793
+ | 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. |
794
+ | disabled | boolean | false | When present, it specifies that the element should be disabled. |
795
+ | fluid | boolean | null | Spans 100% width of the container when enabled. |
796
+ | class | any | - | Style class of the component. |
797
+ | style | any | - | Inline style of the component. |
798
+ | buttonProps | ButtonHTMLAttributes | - | Used to pass all properties of the HTMLButtonElement to the default button. |
799
+ | menuButtonProps | ButtonHTMLAttributes | - | Used to pass all properties of the HTMLButtonElement to the menu button. |
800
+ | menuButtonIcon | string | - | Name of the menu button icon. |
801
+ | dropdownIcon | string | - | Name of the menu button icon. |
802
+ | severity | HintedString<"secondary" \| "info" \| "success" \| "warn" \| "danger" \| "contrast" \| "help"> | - | Defines the style of the button. |
803
+ | raised | boolean | false | Add a shadow to indicate elevation. |
804
+ | rounded | boolean | false | Add a circular border radius to the button. |
805
+ | text | boolean | false | Add a textual class to the button without a background initially. |
806
+ | outlined | boolean | false | Add a border class without a background initially. |
807
+ | size | HintedString<"small" \| "large"> | - | Defines the size of the button. |
808
+ | plain | boolean | false | Add a plain textual class to the button without a background initially. |
809
+ | dt | any | - | It generates scoped CSS variables using design tokens for the component. |
810
+ | pt | PassThrough<SplitButtonPassThroughOptions> | - | Used to pass attributes to DOM elements inside the component. |
811
+ | ptOptions | any | - | Used to configure passthrough(pt) options of the component. |
812
+ | unstyled | boolean | false | When enabled, it removes component related styles in the core. |
813
+
814
+ ### Pass Through Options
815
+
816
+ | Name |Type |Description |
817
+ | --- | --- | --- |
818
+ | root | SplitButtonPassThroughOptionType | Used to pass attributes to the root's DOM element. |
819
+ | pcButton | any | Used to pass attributes to the Button component. |
820
+ | pcDropdown | any | Used to pass attributes to the Button component. |
821
+ | pcMenu | any | Used to pass attributes to the TieredMenu component. |
822
+ | hooks | any | Used to manage all lifecycle hooks. |
823
+
824
+ ### Theming
825
+
826
+ ### CSS Classes
827
+
828
+ | Class |Description |
829
+ | --- | --- |
830
+ | p-splitbutton | Class name of the root element |
831
+ | p-splitbutton-button | Class name of the button element |
832
+ | p-splitbutton-dropdown | Class name of the dropdown element |
833
+
834
+ ### Design Tokens
835
+
836
+ | Token |CSS Variable |Description |
837
+ | --- | --- | --- |
838
+ | splitbutton.border.radius | --p-splitbutton-border-radius | Border radius of root |
839
+ | splitbutton.rounded.border.radius | --p-splitbutton-rounded-border-radius | Rounded border radius of root |
840
+ | splitbutton.raised.shadow | --p-splitbutton-raised-shadow | Raised shadow of root |