@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,629 @@
1
+ # Accordion
2
+
3
+ Accordion groups a collection of contents in tabs.
4
+
5
+ ## Basic
6
+
7
+ A simple accordion with expandable panels controlled via the value prop.
8
+
9
+ ```vue
10
+ <template>
11
+ <div class="flex justify-center">
12
+ <Accordion class="w-full max-w-md">
13
+ <AccordionPanel value="0">
14
+ <AccordionHeader>What is this service about?</AccordionHeader>
15
+ <AccordionContent>
16
+ <p class="m-0 text-sm">This service helps you manage your projects more efficiently by offering real-time collaboration, task tracking, and powerful analytics.</p>
17
+ </AccordionContent>
18
+ </AccordionPanel>
19
+ <AccordionPanel value="1">
20
+ <AccordionHeader>Is my data secure?</AccordionHeader>
21
+ <AccordionContent>
22
+ <p class="m-0 text-sm">Yes. We use end-to-end encryption and follow industry best practices to ensure your data is protected. Your information is stored on secure servers and regularly backed up.</p>
23
+ </AccordionContent>
24
+ </AccordionPanel>
25
+ <AccordionPanel value="2">
26
+ <AccordionHeader>Can I upgrade or downgrade my plan later?</AccordionHeader>
27
+ <AccordionContent>
28
+ <p class="m-0 text-sm">Absolutely. You can change your subscription plan at any time from your account settings. Changes take effect immediately, and any billing adjustments are handled automatically.</p>
29
+ </AccordionContent>
30
+ </AccordionPanel>
31
+ </Accordion>
32
+ </div>
33
+ </template>
34
+ ```
35
+
36
+ ## Multiple
37
+
38
+ By default, a single panel is open at a time. Enable multiple to allow multiple panels to stay open.
39
+
40
+ ```vue
41
+ <template>
42
+ <div class="flex justify-center">
43
+ <Accordion v-model:value="active" multiple class="w-full max-w-md">
44
+ <AccordionPanel value="0">
45
+ <AccordionHeader>What is this service about?</AccordionHeader>
46
+ <AccordionContent>
47
+ <p class="m-0 text-sm">
48
+ This service helps you manage your projects more efficiently by offering real-time collaboration, task tracking, and powerful analytics. Whether you're working solo or in a team, it's built to scale with your needs.
49
+ </p>
50
+ </AccordionContent>
51
+ </AccordionPanel>
52
+ <AccordionPanel value="1">
53
+ <AccordionHeader>Is my data secure?</AccordionHeader>
54
+ <AccordionContent>
55
+ <p class="m-0 text-sm">Yes. We use end-to-end encryption and follow industry best practices to ensure your data is protected. Your information is stored on secure servers and regularly backed up.</p>
56
+ </AccordionContent>
57
+ </AccordionPanel>
58
+ <AccordionPanel value="2">
59
+ <AccordionHeader>Can I upgrade or downgrade my plan later?</AccordionHeader>
60
+ <AccordionContent>
61
+ <p class="m-0 text-sm">Absolutely. You can change your subscription plan at any time from your account settings. Changes take effect immediately, and any billing adjustments are handled automatically.</p>
62
+ </AccordionContent>
63
+ </AccordionPanel>
64
+ </Accordion>
65
+ </div>
66
+ </template>
67
+
68
+ <script setup>
69
+ import { ref } from 'vue';
70
+
71
+ const active = ref(null);
72
+ <\/script>
73
+ ```
74
+
75
+ ## Controlled
76
+
77
+ Control the active panel state with value and update:value .
78
+
79
+ ```vue
80
+ <template>
81
+ <div class="flex justify-center">
82
+ <div class="w-full max-w-md space-y-4">
83
+ <div class="flex gap-2 justify-center">
84
+ <Button type="button" :severity="active === '0' ? 'primary' : 'secondary'" @click="active = '0'">Panel 1</Button>
85
+ <Button type="button" :severity="active === '1' ? 'primary' : 'secondary'" @click="active = '1'">Panel 2</Button>
86
+ <Button type="button" :severity="active === '2' ? 'primary' : 'secondary'" @click="active = '2'">Panel 3</Button>
87
+ <Button type="button" severity="danger" @click="active = null">Close All</Button>
88
+ </div>
89
+ <Accordion v-model:value="active">
90
+ <AccordionPanel value="0">
91
+ <AccordionHeader>What is this service about?</AccordionHeader>
92
+ <AccordionContent>
93
+ <p class="m-0 text-sm">This service helps you manage your projects more efficiently by offering real-time collaboration, task tracking, and powerful analytics.</p>
94
+ </AccordionContent>
95
+ </AccordionPanel>
96
+ <AccordionPanel value="1">
97
+ <AccordionHeader>Is my data secure?</AccordionHeader>
98
+ <AccordionContent>
99
+ <p class="m-0 text-sm">Yes. We use end-to-end encryption and follow industry best practices to ensure your data is protected. Your information is stored on secure servers and regularly backed up.</p>
100
+ </AccordionContent>
101
+ </AccordionPanel>
102
+ <AccordionPanel value="2">
103
+ <AccordionHeader>Can I upgrade or downgrade my plan later?</AccordionHeader>
104
+ <AccordionContent>
105
+ <p class="m-0 text-sm">Absolutely. You can change your subscription plan at any time from your account settings. Changes take effect immediately, and any billing adjustments are handled automatically.</p>
106
+ </AccordionContent>
107
+ </AccordionPanel>
108
+ </Accordion>
109
+ </div>
110
+ </div>
111
+ </template>
112
+
113
+ <script setup>
114
+ import { ref } from 'vue';
115
+
116
+ const active = ref('0');
117
+ <\/script>
118
+ ```
119
+
120
+ ## Trigger
121
+
122
+ The trigger can be tailored per panel; the toggleicon slot animates a custom icon via the header's data-p attribute, while the asChild slot exposes onClick and active so the toggle can be rendered as any element, such as a Button .
123
+
124
+ ```vue
125
+ <template>
126
+ <Accordion class="max-w-md mx-auto" multiple>
127
+ <AccordionPanel value="1">
128
+ <AccordionHeader>
129
+ <template #toggleicon>
130
+ <Plus class="transition-transform ease-out in-data-[p=active]:rotate-45" />
131
+ </template>
132
+ What is this service about?
133
+ </AccordionHeader>
134
+ <AccordionContent>
135
+ <p class="m-0 text-sm">
136
+ This service helps you manage your projects more efficiently by offering real-time collaboration, task tracking, and powerful analytics. Whether you're working solo or in a team, it's built to scale with your needs.
137
+ </p>
138
+ </AccordionContent>
139
+ </AccordionPanel>
140
+ <AccordionPanel value="2">
141
+ <AccordionHeader asChild>
142
+ <template #default="{ active, a11yAttrs, onClick }">
143
+ <div class="flex items-center justify-between gap-4 p-4 bg-(--p-accordion-header-background)">
144
+ <span class="text-sm font-semibold text-(--p-accordion-header-color)">Is my data secure?</span>
145
+ <Button variant="outlined" size="small" v-bind="a11yAttrs" @click="onClick">{{ active ? 'Hide' : 'Show' }}</Button>
146
+ </div>
147
+ </template>
148
+ </AccordionHeader>
149
+ <AccordionContent>
150
+ <p class="m-0 text-sm">Yes. We use end-to-end encryption and follow industry best practices to ensure your data is protected. Your information is stored on secure servers and regularly backed up.</p>
151
+ </AccordionContent>
152
+ </AccordionPanel>
153
+ <AccordionPanel value="3">
154
+ <AccordionHeader>
155
+ <template #toggleicon><span class="hidden" /></template>
156
+ <span class="inline-flex items-center gap-2">
157
+ <Plus class="transition-transform ease-out in-data-[p=active]:rotate-45" />
158
+ Can I upgrade or downgrade my plan later?
159
+ </span>
160
+ </AccordionHeader>
161
+ <AccordionContent>
162
+ <p class="m-0 text-sm">Absolutely. You can change your subscription plan at any time from your account settings. Changes take effect immediately, and any billing adjustments are handled automatically.</p>
163
+ </AccordionContent>
164
+ </AccordionPanel>
165
+ </Accordion>
166
+ </template>
167
+
168
+ <script setup>
169
+ import Plus from '@primeicons/vue/plus';
170
+ <\/script>
171
+ ```
172
+
173
+ ## Indicator
174
+
175
+ The toggleicon slot customizes the indicator. It can switch between two icons using the active context variable, or render a single icon that animates purely with CSS by targeting the header's data-p attribute.
176
+
177
+ ```vue
178
+ <template>
179
+ <div class="flex flex-col gap-8">
180
+ <div>
181
+ <h3 class="text-sm! font-medium! text-surface-500! mb-2">Match open / closed</h3>
182
+ <Accordion class="max-w-md mx-auto">
183
+ <AccordionPanel value="1">
184
+ <AccordionHeader>
185
+ <template #toggleicon="{ active }">
186
+ <Minus v-if="active" />
187
+ <Plus v-else />
188
+ </template>
189
+ What is this service about?
190
+ </AccordionHeader>
191
+ <AccordionContent>
192
+ <p class="m-0 text-sm">
193
+ This service helps you manage your projects more efficiently by offering real-time collaboration, task tracking, and powerful analytics. Whether you're working solo or in a team, it's built to scale with your needs.
194
+ </p>
195
+ </AccordionContent>
196
+ </AccordionPanel>
197
+ <AccordionPanel value="2">
198
+ <AccordionHeader>
199
+ <template #toggleicon="{ active }">
200
+ <Minus v-if="active" />
201
+ <Plus v-else />
202
+ </template>
203
+ Is my data secure?
204
+ </AccordionHeader>
205
+ <AccordionContent>
206
+ <p class="m-0 text-sm">Yes. We use end-to-end encryption and follow industry best practices to ensure your data is protected. Your information is stored on secure servers and regularly backed up.</p>
207
+ </AccordionContent>
208
+ </AccordionPanel>
209
+ <AccordionPanel value="3">
210
+ <AccordionHeader>
211
+ <template #toggleicon="{ active }">
212
+ <Minus v-if="active" />
213
+ <Plus v-else />
214
+ </template>
215
+ Can I upgrade or downgrade my plan later?
216
+ </AccordionHeader>
217
+ <AccordionContent>
218
+ <p class="m-0 text-sm">Absolutely. You can change your subscription plan at any time from your account settings. Changes take effect immediately, and any billing adjustments are handled automatically.</p>
219
+ </AccordionContent>
220
+ </AccordionPanel>
221
+ </Accordion>
222
+ </div>
223
+
224
+ <div>
225
+ <h3 class="text-sm! font-medium! text-surface-500! mb-2">CSS-only with data attributes</h3>
226
+ <Accordion class="max-w-md mx-auto">
227
+ <AccordionPanel value="1">
228
+ <AccordionHeader>
229
+ <template #toggleicon>
230
+ <ChevronDown class="transition-transform duration-200 in-data-[p=active]:rotate-180" />
231
+ </template>
232
+ What is this service about?
233
+ </AccordionHeader>
234
+ <AccordionContent>
235
+ <p class="m-0 text-sm">
236
+ This service helps you manage your projects more efficiently by offering real-time collaboration, task tracking, and powerful analytics. Whether you're working solo or in a team, it's built to scale with your needs.
237
+ </p>
238
+ </AccordionContent>
239
+ </AccordionPanel>
240
+ <AccordionPanel value="2">
241
+ <AccordionHeader>
242
+ <template #toggleicon>
243
+ <ChevronDown class="transition-transform duration-200 in-data-[p=active]:rotate-180" />
244
+ </template>
245
+ Is my data secure?
246
+ </AccordionHeader>
247
+ <AccordionContent>
248
+ <p class="m-0 text-sm">Yes. We use end-to-end encryption and follow industry best practices to ensure your data is protected. Your information is stored on secure servers and regularly backed up.</p>
249
+ </AccordionContent>
250
+ </AccordionPanel>
251
+ </Accordion>
252
+ </div>
253
+ </div>
254
+ </template>
255
+
256
+ <script setup>
257
+ import ChevronDown from '@primeicons/vue/chevron-down';
258
+ import Minus from '@primeicons/vue/minus';
259
+ import Plus from '@primeicons/vue/plus';
260
+ <\/script>
261
+ ```
262
+
263
+ ## Disabled
264
+
265
+ Set disabled on an AccordionPanel to prevent user interaction with that panel.
266
+
267
+ ```vue
268
+ <template>
269
+ <div class="flex justify-center">
270
+ <div class="w-full max-w-md space-y-8">
271
+ <Accordion>
272
+ <AccordionPanel value="0" disabled>
273
+ <AccordionHeader>How do I reset my password?</AccordionHeader>
274
+ <AccordionContent>
275
+ <p class="m-0 text-sm">You can reset your password by clicking the "Forgot password?" link on the login page. We'll send a password reset link to your registered email address.</p>
276
+ </AccordionContent>
277
+ </AccordionPanel>
278
+ <AccordionPanel value="1" disabled>
279
+ <AccordionHeader>Do you offer team accounts?</AccordionHeader>
280
+ <AccordionContent>
281
+ <p class="m-0 text-sm">Yes. Our Team and Business plans are designed for collaboration. You can invite team members, assign roles, and manage permissions easily from your dashboard.</p>
282
+ </AccordionContent>
283
+ </AccordionPanel>
284
+ </Accordion>
285
+ <Accordion>
286
+ <AccordionPanel value="0">
287
+ <AccordionHeader>What happens if I exceed my usage limit?</AccordionHeader>
288
+ <AccordionContent>
289
+ <p class="m-0 text-sm">If you go over your plan limits (e.g., storage or API requests), you'll receive a notification. You can either upgrade your plan or wait until the next billing cycle resets.</p>
290
+ </AccordionContent>
291
+ </AccordionPanel>
292
+ <AccordionPanel value="1" disabled>
293
+ <AccordionHeader>Is there a mobile app available?</AccordionHeader>
294
+ <AccordionContent>
295
+ <p class="m-0 text-sm">Yes, we offer both iOS and Android apps so you can manage your account and stay connected on the go.</p>
296
+ </AccordionContent>
297
+ </AccordionPanel>
298
+ </Accordion>
299
+ </div>
300
+ </div>
301
+ </template>
302
+ ```
303
+
304
+ ## Template
305
+
306
+ Create accordion panels dynamically by iterating over a data source to keep structure consistent and reusable.
307
+
308
+ ```vue
309
+ <template>
310
+ <div class="flex justify-center">
311
+ <Accordion class="w-full max-w-md">
312
+ <AccordionPanel value="0">
313
+ <AccordionHeader>
314
+ <template #toggleicon="{ active }">
315
+ <Minus v-if="active" />
316
+ <Plus v-else />
317
+ </template>
318
+ <span class="flex items-center gap-4">
319
+ <QuestionCircle class="text-yellow-500" />
320
+ <span class="font-medium">What is this service about?</span>
321
+ </span>
322
+ </AccordionHeader>
323
+ <AccordionContent>
324
+ <p class="m-0 text-sm">
325
+ This service helps you manage your projects more efficiently by offering real-time collaboration, task tracking, and powerful analytics. Whether you're working solo or in a team, it's built to scale with your needs.
326
+ </p>
327
+ </AccordionContent>
328
+ </AccordionPanel>
329
+ <AccordionPanel value="1">
330
+ <AccordionHeader>
331
+ <template #toggleicon="{ active }">
332
+ <Minus v-if="active" />
333
+ <Plus v-else />
334
+ </template>
335
+ <span class="flex items-center gap-4">
336
+ <Lock class="text-blue-500" />
337
+ <span class="font-medium">Is my data secure?</span>
338
+ </span>
339
+ </AccordionHeader>
340
+ <AccordionContent>
341
+ <p class="m-0 text-sm">Yes. We use end-to-end encryption and follow industry best practices to ensure your data is protected. Your information is stored on secure servers and regularly backed up.</p>
342
+ </AccordionContent>
343
+ </AccordionPanel>
344
+ <AccordionPanel value="2">
345
+ <AccordionHeader>
346
+ <template #toggleicon="{ active }">
347
+ <Minus v-if="active" />
348
+ <Plus v-else />
349
+ </template>
350
+ <span class="flex items-center gap-4">
351
+ <CreditCard class="text-green-500" />
352
+ <span class="font-medium">Can I upgrade or downgrade my plan later?</span>
353
+ </span>
354
+ </AccordionHeader>
355
+ <AccordionContent>
356
+ <p class="m-0 text-sm">Absolutely. You can change your subscription plan at any time from your account settings. Changes take effect immediately, and any billing adjustments are handled automatically.</p>
357
+ </AccordionContent>
358
+ </AccordionPanel>
359
+ </Accordion>
360
+ </div>
361
+ </template>
362
+
363
+ <script setup>
364
+ import CreditCard from '@primeicons/vue/credit-card';
365
+ import Lock from '@primeicons/vue/lock';
366
+ import Minus from '@primeicons/vue/minus';
367
+ import Plus from '@primeicons/vue/plus';
368
+ import QuestionCircle from '@primeicons/vue/question-circle';
369
+ <\/script>
370
+ ```
371
+
372
+ ## With RadioButton
373
+
374
+ RadioButton component can be used to group multiple AccordionPanel components.
375
+
376
+ ```vue
377
+ <template>
378
+ <div class="flex justify-center">
379
+ <div class="w-full max-w-sm">
380
+ <Accordion v-model:value="selected" class="w-full block border border-surface-200 dark:border-surface-700 rounded-md divide-y divide-surface-200 dark:divide-surface-700">
381
+ <AccordionPanel v-for="item in items" :key="item.value" :value="item.value">
382
+ <AccordionHeader>
383
+ <template #toggleicon>
384
+ <span></span>
385
+ </template>
386
+ <span class="flex items-center gap-3 w-full">
387
+ <RadioButton v-model="selected" :value="item.value" />
388
+ <span class="flex items-center justify-between flex-1">
389
+ <span class="font-semibold text-base">{{ item.label }}</span>
390
+ <span class="font-semibold text-base">{{ item.price }}</span>
391
+ </span>
392
+ </span>
393
+ </AccordionHeader>
394
+ <AccordionContent>
395
+ <p class="m-0 text-surface-500 pl-8">{{ item.description }}</p>
396
+ </AccordionContent>
397
+ </AccordionPanel>
398
+ </Accordion>
399
+ <Button class="w-full mt-4" size="large">{{ \`Buy Now for \${selectedPrice}\` }}</Button>
400
+ </div>
401
+ </div>
402
+ </template>
403
+
404
+ <script setup>
405
+ import { computed, ref } from 'vue';
406
+
407
+ const items = ref([
408
+ {
409
+ label: 'Starter Plan',
410
+ description: 'Perfect for individuals getting started. Includes access to core components and community support.',
411
+ value: '0',
412
+ price: '$99'
413
+ },
414
+ {
415
+ label: 'Growth Plan',
416
+ description: 'Ideal for freelancers and small teams. Unlocks advanced UI components and priority email support.',
417
+ value: '1',
418
+ price: '$249'
419
+ },
420
+ {
421
+ label: 'Scale Plan',
422
+ description: 'Best for growing businesses. Includes all features, early access to new releases, and Slack/Jira support.',
423
+ value: '2',
424
+ price: '$499'
425
+ }
426
+ ]);
427
+ const selected = ref('0');
428
+ const selectedPrice = computed(() => items.value.find((item) => item.value === selected.value)?.price ?? '');
429
+ <\/script>
430
+ ```
431
+
432
+ ## Dynamic
433
+
434
+ AccordionPanel can be generated dynamically using the standard v-for directive.
435
+
436
+ ```vue
437
+ <template>
438
+ <div>
439
+ <Accordion v-model:value="active">
440
+ <AccordionPanel v-for="tab in tabs" :key="tab.title" :value="tab.value">
441
+ <AccordionHeader>{{ tab.title }}</AccordionHeader>
442
+ <AccordionContent>
443
+ <p class="m-0 text-sm">{{ tab.content }}</p>
444
+ </AccordionContent>
445
+ </AccordionPanel>
446
+ </Accordion>
447
+ </div>
448
+ </template>
449
+
450
+ <script setup>
451
+ import { ref } from 'vue';
452
+
453
+ const active = ref(['0']);
454
+ const tabs = ref([
455
+ { title: 'Title 1', content: 'Content 1', value: '0' },
456
+ { title: 'Title 2', content: 'Content 2', value: '1' },
457
+ { title: 'Title 3', content: 'Content 3', value: '2' }
458
+ ]);
459
+ <\/script>
460
+ ```
461
+
462
+ ## Accessibility
463
+
464
+ Screen Reader Accordion header elements have a button role and use aria-controls to define the id of the content section along with aria-expanded for the visibility state. The value to read a header element defaults to the value of the header property and can be customized by defining an aria-label or aria-labelledby property. Each header has a heading role, for which the level is customized by headerAriaLevel and has a default level of 2 as per W3C specifications. Disabled accordions headers use aria-disabled and are excluded from the keybord navigation. The content uses region role, defines an id that matches the aria-controls of the header and aria-labelledby referring to the id of the header. Header Keyboard Support Key Function tab Moves focus to the next the focusable element in the page tab sequence. shift + tab Moves focus to the previous the focusable element in the page tab sequence. enter Toggles the visibility of the content. space Toggles the visibility of the content. down arrow Moves focus to the next header. up arrow Moves focus to the previous header. home Moves focus to the first header. end Moves focus to the last header.
465
+
466
+ ## Accordion API
467
+
468
+ ### Props
469
+
470
+ | Name |Type |Default |Description |
471
+ | --- | --- | --- | --- |
472
+ | value | null \| string \| number \| string[] \| number[] | null | Value of the active panel or an array of values in multiple mode. |
473
+ | multiple | boolean | false | When enabled, multiple tabs can be activated at the same time. |
474
+ | lazy | boolean | false | When enabled, hidden tabs are not rendered at all. Defaults to false that hides tabs with css. |
475
+ | expandIcon | string | - | Icon of a collapsed tab. |
476
+ | collapseIcon | string | - | Icon of an expanded tab. |
477
+ | tabindex | number | 0 | Index of the element in tabbing order. |
478
+ | selectOnFocus | boolean | false | When enabled, the focused tab is activated. |
479
+ | dt | any | - | It generates scoped CSS variables using design tokens for the component. |
480
+ | pt | PassThrough<AccordionPassThroughOptions> | - | Used to pass attributes to DOM elements inside the component. |
481
+ | ptOptions | any | - | Used to configure passthrough(pt) options of the component. |
482
+ | unstyled | boolean | false | When enabled, it removes component related styles in the core. |
483
+
484
+ ### Pass Through Options
485
+
486
+ | Name |Type |Description |
487
+ | --- | --- | --- |
488
+ | root | AccordionPassThroughOptionType | Used to pass attributes to the root's DOM element. |
489
+ | hooks | any | Used to manage all lifecycle hooks. |
490
+
491
+ ### Theming
492
+
493
+ ### CSS Classes
494
+
495
+ | Class |Description |
496
+ | --- | --- |
497
+ | p-accordion | Class name of the root element |
498
+
499
+ ### Design Tokens
500
+
501
+ | Token |CSS Variable |Description |
502
+ | --- | --- | --- |
503
+ | accordion.transition.duration | --p-accordion-transition-duration | Transition duration of root |
504
+ | accordion.panel.border.width | --p-accordion-panel-border-width | Border width of panel |
505
+ | accordion.panel.border.color | --p-accordion-panel-border-color | Border color of panel |
506
+ | accordion.header.color | --p-accordion-header-color | Color of header |
507
+ | accordion.header.hover.color | --p-accordion-header-hover-color | Hover color of header |
508
+ | accordion.header.active.color | --p-accordion-header-active-color | Active color of header |
509
+ | accordion.header.active.hover.color | --p-accordion-header-active-hover-color | Active hover color of header |
510
+ | accordion.header.padding | --p-accordion-header-padding | Padding of header |
511
+ | accordion.header.font.weight | --p-accordion-header-font-weight | Font weight of header |
512
+ | accordion.header.font.size | --p-accordion-header-font-size | Font size of header |
513
+ | accordion.header.border.radius | --p-accordion-header-border-radius | Border radius of header |
514
+ | accordion.header.border.width | --p-accordion-header-border-width | Border width of header |
515
+ | accordion.header.border.color | --p-accordion-header-border-color | Border color of header |
516
+ | accordion.header.background | --p-accordion-header-background | Background of header |
517
+ | accordion.header.hover.background | --p-accordion-header-hover-background | Hover background of header |
518
+ | accordion.header.active.background | --p-accordion-header-active-background | Active background of header |
519
+ | accordion.header.active.hover.background | --p-accordion-header-active-hover-background | Active hover background of header |
520
+ | accordion.header.focus.ring.width | --p-accordion-header-focus-ring-width | Focus ring width of header |
521
+ | accordion.header.focus.ring.style | --p-accordion-header-focus-ring-style | Focus ring style of header |
522
+ | accordion.header.focus.ring.color | --p-accordion-header-focus-ring-color | Focus ring color of header |
523
+ | accordion.header.focus.ring.offset | --p-accordion-header-focus-ring-offset | Focus ring offset of header |
524
+ | accordion.header.focus.ring.shadow | --p-accordion-header-focus-ring-shadow | Focus ring shadow of header |
525
+ | accordion.header.toggle.icon.color | --p-accordion-header-toggle-icon-color | Toggle icon color of header |
526
+ | accordion.header.toggle.icon.hover.color | --p-accordion-header-toggle-icon-hover-color | Toggle icon hover color of header |
527
+ | accordion.header.toggle.icon.active.color | --p-accordion-header-toggle-icon-active-color | Toggle icon active color of header |
528
+ | accordion.header.toggle.icon.active.hover.color | --p-accordion-header-toggle-icon-active-hover-color | Toggle icon active hover color of header |
529
+ | accordion.header.first.top.border.radius | --p-accordion-header-first-top-border-radius | First top border radius of header |
530
+ | accordion.header.first.border.width | --p-accordion-header-first-border-width | First border width of header |
531
+ | accordion.header.last.bottom.border.radius | --p-accordion-header-last-bottom-border-radius | Last bottom border radius of header |
532
+ | accordion.header.last.active.bottom.border.radius | --p-accordion-header-last-active-bottom-border-radius | Last active bottom border radius of header |
533
+ | accordion.content.border.width | --p-accordion-content-border-width | Border width of content |
534
+ | accordion.content.border.color | --p-accordion-content-border-color | Border color of content |
535
+ | accordion.content.background | --p-accordion-content-background | Background of content |
536
+ | accordion.content.color | --p-accordion-content-color | Color of content |
537
+ | accordion.content.padding | --p-accordion-content-padding | Padding of content |
538
+
539
+ ## Accordion Panel API
540
+
541
+ ### Props
542
+
543
+ | Name |Type |Default |Description |
544
+ | --- | --- | --- | --- |
545
+ | value | undefined \| string \| number | - | Unique value of item. |
546
+ | disabled | boolean | false | Whether the item is disabled. |
547
+ | as | string \| Component | DIV | Use to change the HTML tag of root element. |
548
+ | asChild | boolean | false | When enabled, it changes the default rendered element for the one passed as a child element. |
549
+ | dt | any | - | It generates scoped CSS variables using design tokens for the component. |
550
+ | pt | PassThrough<AccordionPanelPassThroughOptions> | - | Used to pass attributes to DOM elements inside the component. |
551
+ | ptOptions | any | - | Used to configure passthrough(pt) options of the component. |
552
+ | unstyled | boolean | false | When enabled, it removes component related styles in the core. |
553
+
554
+ ### Pass Through Options
555
+
556
+ | Name |Type |Description |
557
+ | --- | --- | --- |
558
+ | root | AccordionPanelPassThroughOptionType | Used to pass attributes to the root's DOM element. |
559
+ | hooks | any | Used to manage all lifecycle hooks. |
560
+
561
+ ### Theming
562
+
563
+ ### CSS Classes
564
+
565
+ | Class |Description |
566
+ | --- | --- |
567
+ | p-accordionpanel | Class name of the root element |
568
+
569
+ ## Accordion Header API
570
+
571
+ ### Props
572
+
573
+ | Name |Type |Default |Description |
574
+ | --- | --- | --- | --- |
575
+ | as | string \| Component | BUTTON | Use to change the HTML tag of root element. |
576
+ | asChild | boolean | false | When enabled, it changes the default rendered element for the one passed as a child element. |
577
+ | dt | any | - | It generates scoped CSS variables using design tokens for the component. |
578
+ | pt | PassThrough<AccordionHeaderPassThroughOptions> | - | Used to pass attributes to DOM elements inside the component. |
579
+ | ptOptions | any | - | Used to configure passthrough(pt) options of the component. |
580
+ | unstyled | boolean | false | When enabled, it removes component related styles in the core. |
581
+
582
+ ### Pass Through Options
583
+
584
+ | Name |Type |Description |
585
+ | --- | --- | --- |
586
+ | root | AccordionHeaderPassThroughOptionType | Used to pass attributes to the root's DOM element. |
587
+ | toggleicon | AccordionHeaderPassThroughOptionType | Used to pass attributes to the root's DOM element. |
588
+ | hooks | any | Used to manage all lifecycle hooks. |
589
+
590
+ ### Theming
591
+
592
+ ### CSS Classes
593
+
594
+ | Class |Description |
595
+ | --- | --- |
596
+ | p-accordionheader | Class name of the root element |
597
+ | p-accordionheader-toggle-icon | Class name of the toggleicon element |
598
+
599
+ ## Accordion Content API
600
+
601
+ ### Props
602
+
603
+ | Name |Type |Default |Description |
604
+ | --- | --- | --- | --- |
605
+ | as | string \| Component | DIV | Use to change the HTML tag of root element. |
606
+ | asChild | boolean | false | When enabled, it changes the default rendered element for the one passed as a child element. |
607
+ | dt | any | - | It generates scoped CSS variables using design tokens for the component. |
608
+ | pt | PassThrough<AccordionContentPassThroughOptions> | - | Used to pass attributes to DOM elements inside the component. |
609
+ | ptOptions | any | - | Used to configure passthrough(pt) options of the component. |
610
+ | unstyled | boolean | false | When enabled, it removes component related styles in the core. |
611
+
612
+ ### Pass Through Options
613
+
614
+ | Name |Type |Description |
615
+ | --- | --- | --- |
616
+ | root | AccordionContentPassThroughOptionType | Used to pass attributes to the root's DOM element. |
617
+ | transition | AccordionContentPassThroughOptionType | Used to pass attributes to the transition's DOM element. |
618
+ | contentWrapper | AccordionContentPassThroughOptionType | Used to pass attributes to the content's wrapper DOM element. |
619
+ | content | AccordionContentPassThroughOptionType | Used to pass attributes to the content's DOM element. |
620
+ | hooks | any | Used to manage all lifecycle hooks. |
621
+
622
+ ### Theming
623
+
624
+ ### CSS Classes
625
+
626
+ | Class |Description |
627
+ | --- | --- |
628
+ | p-accordioncontent | Class name of the root element |
629
+ | p-accordioncontent-content | Class name of the content element |