@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,472 @@
1
+ # Toast
2
+
3
+ Toast is used to display messages in an overlay.
4
+
5
+ ## ToastService
6
+
7
+ Toast component is controlled via the ToastService that needs to be installed as an application plugin.
8
+
9
+ ## Basic
10
+
11
+ Toasts are displayed by calling the add method provided by the useToast function. A single toast is specified by the Message interface that defines various properties such as severity , summary and detail .
12
+
13
+ ```vue
14
+ <template>
15
+ <div class="flex justify-center">
16
+ <Toast />
17
+ <Button variant="outlined" @click="show()">Create toast</Button>
18
+ </div>
19
+ </template>
20
+
21
+ <script setup>
22
+ import { useToast } from 'primevue/usetoast';
23
+
24
+ const toast = useToast();
25
+
26
+ const show = () => {
27
+ toast.add({ summary: 'Successfully completed', detail: 'The task was completed successfully. You can now view the details.', life: 3000 });
28
+ };
29
+ <\/script>
30
+ ```
31
+
32
+ ## Severity
33
+
34
+ The severity option specifies the type of the message. There are four types of messages: success , info , warn and error . The severity of the message is used to display the icon and the color of the toast.
35
+
36
+ ```vue
37
+ <template>
38
+ <div class="flex flex-wrap justify-center gap-2">
39
+ <Toast />
40
+ <Button severity="info" variant="outlined" @click="showInfo">Info</Button>
41
+ <Button severity="success" variant="outlined" @click="showSuccess">Success</Button>
42
+ <Button severity="warn" variant="outlined" @click="showWarn">Warn</Button>
43
+ <Button severity="danger" variant="outlined" @click="showError">Error</Button>
44
+ <Button severity="secondary" variant="outlined" @click="showSecondary">Secondary</Button>
45
+ <Button severity="contrast" variant="outlined" @click="showContrast">Contrast</Button>
46
+ </div>
47
+ </template>
48
+
49
+ <script setup>
50
+ import { useToast } from 'primevue/usetoast';
51
+
52
+ const toast = useToast();
53
+
54
+ const showInfo = () => {
55
+ toast.add({ severity: 'info', summary: 'Heads up', detail: 'There’s something you might want to check.', life: 3000 });
56
+ };
57
+
58
+ const showSuccess = () => {
59
+ toast.add({ severity: 'success', summary: 'Saved successfully', detail: 'Your changes have been saved.', life: 3000 });
60
+ };
61
+
62
+ const showWarn = () => {
63
+ toast.add({ severity: 'warn', summary: 'Check this', detail: 'Some fields may need your attention.', life: 3000 });
64
+ };
65
+
66
+ const showError = () => {
67
+ toast.add({ severity: 'error', summary: 'Something went wrong', detail: 'We couldn’t complete the action. Please try again.', life: 3000 });
68
+ };
69
+
70
+ const showSecondary = () => {
71
+ toast.add({ severity: 'secondary', summary: 'For your information', detail: 'This is a secondary toast message.', life: 3000 });
72
+ };
73
+
74
+ const showContrast = () => {
75
+ toast.add({ severity: 'contrast', summary: 'High contrast', detail: 'This is a contrast toast message.', life: 3000 });
76
+ };
77
+ <\/script>
78
+ ```
79
+
80
+ ## Promise
81
+
82
+ A sticky loading toast can be shown while an async task runs, then removed and replaced with a success or error toast based on the result.
83
+
84
+ ```vue
85
+ <template>
86
+ <div class="flex flex-wrap items-center justify-center gap-4">
87
+ <Toast group="promise" />
88
+ <Button variant="outlined" @click="runPromise">Run promise</Button>
89
+ </div>
90
+ </template>
91
+
92
+ <script setup>
93
+ import Spinner from '@primeicons/vue/spinner';
94
+ import { useToast } from 'primevue/usetoast';
95
+
96
+ const toast = useToast();
97
+
98
+ const fakeApiCall = () =>
99
+ new Promise((resolve, reject) => {
100
+ setTimeout(() => {
101
+ Math.random() < 0.5 ? resolve('Success!') : reject(new Error('Something went wrong'));
102
+ }, 2000);
103
+ });
104
+
105
+ const runPromise = () => {
106
+ const loading = {
107
+ severity: 'secondary',
108
+ summary: 'Please wait...',
109
+ detail: 'Your request is being processed. This may take a moment.',
110
+ icon: markRaw({
111
+ render: () => h(Spinner, { spin: true })
112
+ }),
113
+ group: 'promise',
114
+ sticky: true
115
+ };
116
+
117
+ toast.add(loading);
118
+
119
+ fakeApiCall()
120
+ .then((result) => {
121
+ toast.remove(loading);
122
+ toast.add({ severity: 'success', summary: 'Success!', detail: \`\${result}. Everything went smoothly. Thank you for your patience.\`, group: 'promise', life: 3000 });
123
+ })
124
+ .catch((error) => {
125
+ toast.remove(loading);
126
+ toast.add({ severity: 'error', summary: 'Oops, something went wrong', detail: \`Error: \${error.message}. Please try again or contact support if the problem persists.\`, group: 'promise', life: 3000 });
127
+ });
128
+ };
129
+ <\/script>
130
+ ```
131
+
132
+ ## Sticky
133
+
134
+ A toast disappears after the time defined by the life option, set sticky option true on the message to override this and not hide the toast automatically.
135
+
136
+ ```vue
137
+ <template>
138
+ <div class="flex justify-center">
139
+ <Toast />
140
+ <div class="flex flex-wrap gap-2">
141
+ <Button variant="outlined" @click="show()">Create toast</Button>
142
+ <Button variant="outlined" severity="secondary" @click="clear()">Dismiss toast</Button>
143
+ </div>
144
+ </div>
145
+ </template>
146
+
147
+ <script setup>
148
+ import { useToast } from 'primevue/usetoast';
149
+
150
+ const toast = useToast();
151
+
152
+ const show = () => {
153
+ toast.add({ severity: 'info', summary: 'Sticky toast', detail: 'This toast stays until you dismiss it manually.', sticky: true });
154
+ };
155
+
156
+ const clear = () => {
157
+ toast.removeAllGroups();
158
+ };
159
+ <\/script>
160
+ ```
161
+
162
+ ## Custom
163
+
164
+ The toast content can be fully customized with a template to render any markup, such as links and action buttons.
165
+
166
+ ```vue
167
+ <template>
168
+ <div class="flex justify-center">
169
+ <Toast group="custom" :pt="{ closeButton: { class: 'hidden!' } }">
170
+ <template #message>
171
+ <div class="space-y-2 w-full">
172
+ <div>
173
+ <h1 class="text-sm! m-0! font-medium! text-surface-900 dark:text-surface-0 leading-6">
174
+ Purchase complete!
175
+ <a class="cursor-pointer underline! hover:opacity-75">View receipt</a>
176
+ </h1>
177
+ <p class="text-surface-500 mt-1 text-sm">
178
+ Your order is being processed. Track all orders or
179
+ <a class="cursor-pointer underline! hover:opacity-75">learn about returns</a>
180
+ </p>
181
+ </div>
182
+ <div class="flex items-center mt-3 gap-2">
183
+ <button
184
+ type="button"
185
+ @click="dismiss()"
186
+ class="font-medium px-2 py-1.5 text-xs rounded-md border border-surface-200 dark:border-surface-700 hover:bg-surface-50 active:bg-surface-100 dark:hover:bg-surface-800 dark:active:bg-surface-700 text-surface-500 dark:text-surface-400"
187
+ >
188
+ Dismiss
189
+ </button>
190
+ <button
191
+ type="button"
192
+ @click="dismiss()"
193
+ class="font-medium px-2 py-1.5 text-xs rounded-md border border-indigo-500/25 bg-indigo-50 hover:bg-indigo-100 dark:bg-indigo-950/75 dark:hover:bg-indigo-950 text-indigo-500 dark:text-indigo-400"
194
+ >
195
+ Track all orders
196
+ </button>
197
+ </div>
198
+ </div>
199
+ </template>
200
+ </Toast>
201
+ <Button variant="outlined" @click="show()">Custom toast</Button>
202
+ </div>
203
+ </template>
204
+
205
+ <script setup>
206
+ import { useToast } from 'primevue/usetoast';
207
+
208
+ const toast = useToast();
209
+
210
+ const show = () => {
211
+ toast.add({ group: 'custom', life: 6000, summary: 'Purchase complete', styleClass: 'bg-surface-0! dark:bg-surface-900! border-surface!' });
212
+ };
213
+
214
+ const dismiss = () => {
215
+ toast.removeGroup('custom');
216
+ };
217
+ <\/script>
218
+ ```
219
+
220
+ ## Position
221
+
222
+ Location of the toast is customized with the position property. Valid values are top-left , top-center , top-right , bottom-left , bottom-center , bottom-right and center .
223
+
224
+ ```vue
225
+ <template>
226
+ <div class="flex justify-center">
227
+ <Toast position="top-left" group="top-left" />
228
+ <Toast position="top-center" group="top-center" />
229
+ <Toast position="top-right" group="top-right" />
230
+ <Toast position="bottom-left" group="bottom-left" />
231
+ <Toast position="bottom-center" group="bottom-center" />
232
+ <Toast position="bottom-right" group="bottom-right" />
233
+ <Toast position="center" group="center" />
234
+ <div class="flex flex-wrap gap-2">
235
+ <Button variant="outlined" @click="createToast('top-left')">Top Left</Button>
236
+ <Button variant="outlined" @click="createToast('top-center')">Top Center</Button>
237
+ <Button variant="outlined" @click="createToast('top-right')">Top Right</Button>
238
+ <Button variant="outlined" @click="createToast('bottom-left')">Bottom Left</Button>
239
+ <Button variant="outlined" @click="createToast('bottom-center')">Bottom Center</Button>
240
+ <Button variant="outlined" @click="createToast('bottom-right')">Bottom Right</Button>
241
+ <Button variant="outlined" @click="createToast('center')">Center</Button>
242
+ </div>
243
+ </div>
244
+ </template>
245
+
246
+ <script setup>
247
+ import { useToast } from 'primevue/usetoast';
248
+
249
+ const toast = useToast();
250
+
251
+ const createToast = (group) => {
252
+ toast.add({ summary: 'Successfully completed', detail: 'The task was completed successfully. You can now view the details.', group, life: 3000 });
253
+ };
254
+ <\/script>
255
+ ```
256
+
257
+ ## Expanded Mode
258
+
259
+ Setting mode to expanded always renders the stack expanded; the stacked mode stacks toasts collapsed and expands them on hover. Auto-dismiss timers still pause while the toasts are hovered.
260
+
261
+ ```vue
262
+ <template>
263
+ <div class="flex justify-center">
264
+ <Toast group="expanded" mode="expanded" :limit="7" />
265
+ <Button variant="outlined" @click="show()">Create toast</Button>
266
+ </div>
267
+ </template>
268
+
269
+ <script setup>
270
+ import { useToast } from 'primevue/usetoast';
271
+
272
+ const toast = useToast();
273
+
274
+ const show = () => {
275
+ toast.add({ group: 'expanded', summary: 'Successfully completed', detail: 'The task was completed successfully. You can now view the details.', life: 3000 });
276
+ };
277
+ <\/script>
278
+ ```
279
+
280
+ ## Action
281
+
282
+ An interactive button can be added to the toast content with a custom template, for example to let the user confirm an action.
283
+
284
+ ```vue
285
+ <template>
286
+ <div class="flex justify-center">
287
+ <Toast group="action">
288
+ <template #message="slotProps">
289
+ <Check v-if="slotProps.message.severity === 'success'" />
290
+ <div class="p-toast-message-text">
291
+ <div class="p-toast-summary">{{ slotProps.message.summary }}</div>
292
+ <div class="p-toast-detail">{{ slotProps.message.detail }}</div>
293
+ <Button v-if="slotProps.message.severity !== 'success'" size="small" class="mt-3 self-start" @click="enableCamera()">Enable camera</Button>
294
+ </div>
295
+ </template>
296
+ </Toast>
297
+ <Button variant="outlined" @click="show()">Create toast with action</Button>
298
+ </div>
299
+ </template>
300
+
301
+ <script setup>
302
+ import { useToast } from 'primevue/usetoast';
303
+ import Check from '@primeicons/vue/check';
304
+
305
+ const toast = useToast();
306
+
307
+ const show = () => {
308
+ toast.add({ group: 'action', summary: 'Allow camera access', detail: 'We need access to your camera to scan QR codes.' });
309
+ };
310
+
311
+ const enableCamera = () => {
312
+ toast.removeGroup('action');
313
+ toast.add({ group: 'action', severity: 'success', summary: 'Camera access granted', detail: 'You can now scan QR codes.', life: 3000 });
314
+ };
315
+ <\/script>
316
+ ```
317
+
318
+ ## Accessibility
319
+
320
+ Screen Reader Toast component use alert role that implicitly defines aria-live as "assertive" and aria-atomic as "true". Close element is a button with an aria-label that refers to the aria.close property of the locale API by default, you may use closeButtonProps to customize the element and override the default aria-label . In stacked mode, moving keyboard focus into the toast group expands the stack so hidden close buttons remain reachable. Close Button Keyboard Support Key Function enter Closes the message. space Closes the message.
321
+
322
+ ## Toast API
323
+
324
+ ### Props
325
+
326
+ | Name |Type |Default |Description |
327
+ | --- | --- | --- | --- |
328
+ | group | string | - | Unique identifier of a message group. |
329
+ | position | "center" \| "top-left" \| "top-center" \| "top-right" \| "bottom-left" \| "bottom-center" \| "bottom-right" | top-right | Position of the toast in viewport. |
330
+ | mode | "stacked" \| "expanded" | stacked | Display mode of the toast. In stacked mode, toasts overlap and expand on hover. |
331
+ | gap | number | 12 | Gap between stacked toast items in pixels. * |
332
+ | limit | number | 3 | Maximum number of visible toasts in the stack. * |
333
+ | autoZIndex | boolean | true | Whether to automatically manage layering. |
334
+ | baseZIndex | number | 0 | Base zIndex value to use in layering. |
335
+ | breakpoints | ToastBreakpointsType | - | Object literal to define styles per screen size. |
336
+ | closeIcon | string | - | Icon to display in the toast close button. |
337
+ | infoIcon | string | - | Icon to display in the toast with info severity. |
338
+ | warnIcon | string | - | Icon to display in the toast with warn severity. |
339
+ | errorIcon | string | - | Icon to display in the toast with error severity. |
340
+ | successIcon | string | - | Icon to display in the toast with success severity. |
341
+ | secondaryIcon | string | - | Icon to display in the toast with secondary severity. |
342
+ | contrastIcon | string | - | Icon to display in the toast with contrast severity. |
343
+ | closeButtonProps | ButtonHTMLAttributes | - | Used to pass all properties of the HTMLButtonElement to the close button. |
344
+ | message | ToastMessageOptions | - | Used to access message options. |
345
+ | onMouseEnter | Function | - | Used to specify a callback function to be run when the mouseenter event is fired on the message component. |
346
+ | onMouseLeave | Function | - | Used to specify a callback function to be run when the mouseleave event is fired on the message component. |
347
+ | onClick | Function | - | Used to specify a callback function to be run when the click event is fired on the message component. |
348
+ | dt | any | - | It generates scoped CSS variables using design tokens for the component. |
349
+ | pt | PassThrough<ToastPassThroughOptions> | - | Used to pass attributes to DOM elements inside the component. |
350
+ | ptOptions | any | - | Used to configure passthrough(pt) options of the component. |
351
+ | unstyled | boolean | false | When enabled, it removes component related styles in the core. |
352
+
353
+ ### Pass Through Options
354
+
355
+ | Name |Type |Description |
356
+ | --- | --- | --- |
357
+ | root | ToastPassThroughOptionType | Used to pass attributes to the root's DOM element. |
358
+ | message | ToastPassThroughOptionType | Used to pass attributes to the message's DOM element. |
359
+ | messageContent | ToastPassThroughOptionType | Used to pass attributes to the message content's DOM element. |
360
+ | messageIcon | ToastPassThroughOptionType | Used to pass attributes to the message icon's DOM element. |
361
+ | messageText | ToastPassThroughOptionType | Used to pass attributes to the message text's DOM element. |
362
+ | summary | ToastPassThroughOptionType | Used to pass attributes to the summary's DOM element. |
363
+ | detail | ToastPassThroughOptionType | Used to pass attributes to the detail's DOM element. |
364
+ | buttonContainer | ToastPassThroughOptionType | Used to pass attributes to the button container's DOM element. |
365
+ | closeButton | ToastPassThroughOptionType | Used to pass attributes to the button's DOM element. |
366
+ | closeIcon | ToastPassThroughOptionType | Used to pass attributes to the button icon's DOM element. |
367
+ | hooks | any | Used to manage all lifecycle hooks. |
368
+
369
+ ### Theming
370
+
371
+ ### CSS Classes
372
+
373
+ | Class |Description |
374
+ | --- | --- |
375
+ | p-toast | Class name of the root element |
376
+ | p-toast-message | Class name of the message element |
377
+ | p-toast-message-content | Class name of the message content element |
378
+ | p-toast-message-icon | Class name of the message icon element |
379
+ | p-toast-message-text | Class name of the message text element |
380
+ | p-toast-summary | Class name of the summary element |
381
+ | p-toast-detail | Class name of the detail element |
382
+ | p-toast-close-button | Class name of the close button element |
383
+ | p-toast-close-icon | Class name of the close icon element |
384
+
385
+ ### Design Tokens
386
+
387
+ | Token |CSS Variable |Description |
388
+ | --- | --- | --- |
389
+ | toast.width | --p-toast-width | Width of root |
390
+ | toast.border.radius | --p-toast-border-radius | Border radius of root |
391
+ | toast.border.width | --p-toast-border-width | Border width of root |
392
+ | toast.transition.duration | --p-toast-transition-duration | Transition duration of root |
393
+ | toast.blur | --p-toast-blur | Used to pass tokens of the blur section |
394
+ | toast.focus.ring.width | --p-toast-focus-ring-width | Focus ring width of root |
395
+ | toast.focus.ring.style | --p-toast-focus-ring-style | Focus ring style of root |
396
+ | toast.focus.ring.color | --p-toast-focus-ring-color | Focus ring color of root |
397
+ | toast.focus.ring.offset | --p-toast-focus-ring-offset | Focus ring offset of root |
398
+ | toast.focus.ring.shadow | --p-toast-focus-ring-shadow | Focus ring shadow of root |
399
+ | toast.icon.size | --p-toast-icon-size | Size of icon |
400
+ | toast.icon.margin | --p-toast-icon-margin | Margin of icon |
401
+ | toast.content.padding | --p-toast-content-padding | Padding of content |
402
+ | toast.content.gap | --p-toast-content-gap | Gap of content |
403
+ | toast.text.gap | --p-toast-text-gap | Gap of text |
404
+ | toast.summary.font.weight | --p-toast-summary-font-weight | Font weight of summary |
405
+ | toast.summary.font.size | --p-toast-summary-font-size | Font size of summary |
406
+ | toast.detail.font.weight | --p-toast-detail-font-weight | Font weight of detail |
407
+ | toast.detail.font.size | --p-toast-detail-font-size | Font size of detail |
408
+ | toast.close.button.width | --p-toast-close-button-width | Width of close button |
409
+ | toast.close.button.height | --p-toast-close-button-height | Height of close button |
410
+ | toast.close.button.border.radius | --p-toast-close-button-border-radius | Border radius of close button |
411
+ | toast.close.button.focus.ring.width | --p-toast-close-button-focus-ring-width | Focus ring width of close button |
412
+ | toast.close.button.focus.ring.style | --p-toast-close-button-focus-ring-style | Focus ring style of close button |
413
+ | toast.close.button.focus.ring.offset | --p-toast-close-button-focus-ring-offset | Focus ring offset of close button |
414
+ | toast.close.icon.size | --p-toast-close-icon-size | Size of close icon |
415
+ | toast.normal.background | --p-toast-normal-background | Background of normal |
416
+ | toast.normal.border.color | --p-toast-normal-border-color | Border color of normal |
417
+ | toast.normal.color | --p-toast-normal-color | Color of normal |
418
+ | toast.normal.detail.color | --p-toast-normal-detail-color | Detail color of normal |
419
+ | toast.normal.shadow | --p-toast-normal-shadow | Shadow of normal |
420
+ | toast.normal.close.button.hover.background | --p-toast-normal-close-button-hover-background | Close button hover background of normal |
421
+ | toast.normal.close.button.focus.ring.color | --p-toast-normal-close-button-focus-ring-color | Close button focus ring color of normal |
422
+ | toast.normal.close.button.focus.ring.shadow | --p-toast-normal-close-button-focus-ring-shadow | Close button focus ring shadow of normal |
423
+ | toast.info.background | --p-toast-info-background | Background of info |
424
+ | toast.info.border.color | --p-toast-info-border-color | Border color of info |
425
+ | toast.info.color | --p-toast-info-color | Color of info |
426
+ | toast.info.detail.color | --p-toast-info-detail-color | Detail color of info |
427
+ | toast.info.shadow | --p-toast-info-shadow | Shadow of info |
428
+ | toast.info.close.button.hover.background | --p-toast-info-close-button-hover-background | Close button hover background of info |
429
+ | toast.info.close.button.focus.ring.color | --p-toast-info-close-button-focus-ring-color | Close button focus ring color of info |
430
+ | toast.info.close.button.focus.ring.shadow | --p-toast-info-close-button-focus-ring-shadow | Close button focus ring shadow of info |
431
+ | toast.success.background | --p-toast-success-background | Background of success |
432
+ | toast.success.border.color | --p-toast-success-border-color | Border color of success |
433
+ | toast.success.color | --p-toast-success-color | Color of success |
434
+ | toast.success.detail.color | --p-toast-success-detail-color | Detail color of success |
435
+ | toast.success.shadow | --p-toast-success-shadow | Shadow of success |
436
+ | toast.success.close.button.hover.background | --p-toast-success-close-button-hover-background | Close button hover background of success |
437
+ | toast.success.close.button.focus.ring.color | --p-toast-success-close-button-focus-ring-color | Close button focus ring color of success |
438
+ | toast.success.close.button.focus.ring.shadow | --p-toast-success-close-button-focus-ring-shadow | Close button focus ring shadow of success |
439
+ | toast.warn.background | --p-toast-warn-background | Background of warn |
440
+ | toast.warn.border.color | --p-toast-warn-border-color | Border color of warn |
441
+ | toast.warn.color | --p-toast-warn-color | Color of warn |
442
+ | toast.warn.detail.color | --p-toast-warn-detail-color | Detail color of warn |
443
+ | toast.warn.shadow | --p-toast-warn-shadow | Shadow of warn |
444
+ | toast.warn.close.button.hover.background | --p-toast-warn-close-button-hover-background | Close button hover background of warn |
445
+ | toast.warn.close.button.focus.ring.color | --p-toast-warn-close-button-focus-ring-color | Close button focus ring color of warn |
446
+ | toast.warn.close.button.focus.ring.shadow | --p-toast-warn-close-button-focus-ring-shadow | Close button focus ring shadow of warn |
447
+ | toast.error.background | --p-toast-error-background | Background of error |
448
+ | toast.error.border.color | --p-toast-error-border-color | Border color of error |
449
+ | toast.error.color | --p-toast-error-color | Color of error |
450
+ | toast.error.detail.color | --p-toast-error-detail-color | Detail color of error |
451
+ | toast.error.shadow | --p-toast-error-shadow | Shadow of error |
452
+ | toast.error.close.button.hover.background | --p-toast-error-close-button-hover-background | Close button hover background of error |
453
+ | toast.error.close.button.focus.ring.color | --p-toast-error-close-button-focus-ring-color | Close button focus ring color of error |
454
+ | toast.error.close.button.focus.ring.shadow | --p-toast-error-close-button-focus-ring-shadow | Close button focus ring shadow of error |
455
+ | toast.secondary.background | --p-toast-secondary-background | Background of secondary |
456
+ | toast.secondary.border.color | --p-toast-secondary-border-color | Border color of secondary |
457
+ | toast.secondary.color | --p-toast-secondary-color | Color of secondary |
458
+ | toast.secondary.detail.color | --p-toast-secondary-detail-color | Detail color of secondary |
459
+ | toast.secondary.shadow | --p-toast-secondary-shadow | Shadow of secondary |
460
+ | toast.secondary.close.button.hover.background | --p-toast-secondary-close-button-hover-background | Close button hover background of secondary |
461
+ | toast.secondary.close.button.focus.ring.color | --p-toast-secondary-close-button-focus-ring-color | Close button focus ring color of secondary |
462
+ | toast.secondary.close.button.focus.ring.shadow | --p-toast-secondary-close-button-focus-ring-shadow | Close button focus ring shadow of secondary |
463
+ | toast.contrast.background | --p-toast-contrast-background | Background of contrast |
464
+ | toast.contrast.border.color | --p-toast-contrast-border-color | Border color of contrast |
465
+ | toast.contrast.color | --p-toast-contrast-color | Color of contrast |
466
+ | toast.contrast.detail.color | --p-toast-contrast-detail-color | Detail color of contrast |
467
+ | toast.contrast.shadow | --p-toast-contrast-shadow | Shadow of contrast |
468
+ | toast.contrast.close.button.hover.background | --p-toast-contrast-close-button-hover-background | Close button hover background of contrast |
469
+ | toast.contrast.close.button.focus.ring.color | --p-toast-contrast-close-button-focus-ring-color | Close button focus ring color of contrast |
470
+ | toast.contrast.close.button.focus.ring.shadow | --p-toast-contrast-close-button-focus-ring-shadow | Close button focus ring shadow of contrast |
471
+
472
+ ## Toast Service Use Toast API