@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.
- package/LICENSE.md +45 -21
- package/README.md +48 -250
- package/data/components.json +47269 -0
- package/data/llms/components/accordion.md +629 -0
- package/data/llms/components/animateonscroll.md +165 -0
- package/data/llms/components/autocomplete.md +995 -0
- package/data/llms/components/avatar.md +264 -0
- package/data/llms/components/badge.md +200 -0
- package/data/llms/components/blockui.md +99 -0
- package/data/llms/components/breadcrumb.md +269 -0
- package/data/llms/components/button.md +902 -0
- package/data/llms/components/card.md +209 -0
- package/data/llms/components/carousel.md +506 -0
- package/data/llms/components/cascadeselect.md +1207 -0
- package/data/llms/components/chart.md +1022 -0
- package/data/llms/components/checkbox.md +401 -0
- package/data/llms/components/chip.md +206 -0
- package/data/llms/components/colorpicker.md +213 -0
- package/data/llms/components/commandmenu.md +660 -0
- package/data/llms/components/compare.md +407 -0
- package/data/llms/components/confirmdialog.md +343 -0
- package/data/llms/components/confirmpopup.md +252 -0
- package/data/llms/components/contextmenu.md +522 -0
- package/data/llms/components/datatable.md +5266 -0
- package/data/llms/components/dataview.md +569 -0
- package/data/llms/components/datepicker.md +964 -0
- package/data/llms/components/deferredcontent.md +96 -0
- package/data/llms/components/dialog.md +702 -0
- package/data/llms/components/divider.md +152 -0
- package/data/llms/components/dock.md +488 -0
- package/data/llms/components/drawer.md +469 -0
- package/data/llms/components/dynamicdialog.md +214 -0
- package/data/llms/components/editor.md +205 -0
- package/data/llms/components/fieldset.md +253 -0
- package/data/llms/components/fileupload.md +459 -0
- package/data/llms/components/floatlabel.md +144 -0
- package/data/llms/components/fluid.md +104 -0
- package/data/llms/components/focustrap.md +59 -0
- package/data/llms/components/forms.md +344 -0
- package/data/llms/components/galleria.md +1119 -0
- package/data/llms/components/gallery.md +1003 -0
- package/data/llms/components/iconfield.md +283 -0
- package/data/llms/components/iftalabel.md +96 -0
- package/data/llms/components/image.md +179 -0
- package/data/llms/components/imagecompare.md +108 -0
- package/data/llms/components/inplace.md +183 -0
- package/data/llms/components/inputcolor.md +869 -0
- package/data/llms/components/inputgroup.md +419 -0
- package/data/llms/components/inputmask.md +345 -0
- package/data/llms/components/inputnumber.md +551 -0
- package/data/llms/components/inputotp.md +345 -0
- package/data/llms/components/inputpassword.md +738 -0
- package/data/llms/components/inputtags.md +432 -0
- package/data/llms/components/inputtext.md +569 -0
- package/data/llms/components/installation.md +1 -0
- package/data/llms/components/keyfilter.md +116 -0
- package/data/llms/components/knob.md +318 -0
- package/data/llms/components/label.md +151 -0
- package/data/llms/components/laravel.md +53 -0
- package/data/llms/components/listbox.md +636 -0
- package/data/llms/components/mask.md +203 -0
- package/data/llms/components/mcp.md +39 -0
- package/data/llms/components/megamenu.md +563 -0
- package/data/llms/components/menu.md +651 -0
- package/data/llms/components/menubar.md +446 -0
- package/data/llms/components/message.md +497 -0
- package/data/llms/components/metergroup.md +281 -0
- package/data/llms/components/multiselect.md +752 -0
- package/data/llms/components/orderlist.md +224 -0
- package/data/llms/components/organizationchart.md +418 -0
- package/data/llms/components/paginator.md +221 -0
- package/data/llms/components/panel.md +321 -0
- package/data/llms/components/panelmenu.md +703 -0
- package/data/llms/components/password.md +657 -0
- package/data/llms/components/picklist.md +286 -0
- package/data/llms/components/popover.md +145 -0
- package/data/llms/components/progressbar.md +242 -0
- package/data/llms/components/progressspinner.md +104 -0
- package/data/llms/components/radiobutton.md +427 -0
- package/data/llms/components/rating.md +312 -0
- package/data/llms/components/ripple.md +91 -0
- package/data/llms/components/scrollarea.md +700 -0
- package/data/llms/components/scrollpanel.md +131 -0
- package/data/llms/components/scrolltop.md +87 -0
- package/data/llms/components/select.md +1251 -0
- package/data/llms/components/selectbutton.md +268 -0
- package/data/llms/components/sidebar.md +2232 -0
- package/data/llms/components/skeleton.md +302 -0
- package/data/llms/components/slider.md +416 -0
- package/data/llms/components/speeddial.md +402 -0
- package/data/llms/components/splitbutton.md +840 -0
- package/data/llms/components/splitter.md +447 -0
- package/data/llms/components/stepper.md +551 -0
- package/data/llms/components/styleclass.md +226 -0
- package/data/llms/components/tabs.md +609 -0
- package/data/llms/components/tag.md +178 -0
- package/data/llms/components/terminal.md +123 -0
- package/data/llms/components/textarea.md +519 -0
- package/data/llms/components/tieredmenu.md +578 -0
- package/data/llms/components/timeline.md +494 -0
- package/data/llms/components/toast.md +472 -0
- package/data/llms/components/togglebutton.md +276 -0
- package/data/llms/components/toggleswitch.md +271 -0
- package/data/llms/components/toolbar.md +140 -0
- package/data/llms/components/tooltip.md +160 -0
- package/data/llms/components/tree.md +1076 -0
- package/data/llms/components/treeselect.md +660 -0
- package/data/llms/components/treetable.md +2493 -0
- package/data/llms/components/virtualscroller.md +265 -0
- package/data/llms/guides/autoimport.md +28 -0
- package/data/llms/guides/cdn.md +72 -0
- package/data/llms/guides/configuration.md +158 -0
- package/data/llms/guides/customicons.md +67 -0
- package/data/llms/guides/guides/accessibility.md +27 -0
- package/data/llms/guides/guides/animations.md +119 -0
- package/data/llms/guides/guides/rtl.md +7 -0
- package/data/llms/guides/icons.md +136 -0
- package/data/llms/guides/installation.md +3 -0
- package/data/llms/guides/laravel.md +66 -0
- package/data/llms/guides/llms.md +15 -0
- package/data/llms/guides/mcp.md +104 -0
- package/data/llms/guides/migration/v4.md +15 -0
- package/data/llms/guides/migration/v5.md +15 -0
- package/data/llms/guides/nuxt.md +141 -0
- package/data/llms/guides/passthrough.md +137 -0
- package/data/llms/guides/primeclt.md +43 -0
- package/data/llms/guides/tailwind.md +151 -0
- package/data/llms/guides/theming/styled.md +497 -0
- package/data/llms/guides/theming/unstyled.md +57 -0
- package/data/llms/guides/uikit.md +3 -0
- package/data/llms/guides/vite.md +90 -0
- package/data/llms/llms-full.txt +54465 -0
- package/data/llms/llms.txt +132 -0
- package/data/llms/pages/accessibility.md +27 -0
- package/data/llms/pages/animations.md +119 -0
- package/data/llms/pages/autoimport.md +28 -0
- package/data/llms/pages/cdn.md +72 -0
- package/data/llms/pages/configuration.md +158 -0
- package/data/llms/pages/contribution.md +31 -0
- package/data/llms/pages/customicons.md +67 -0
- package/data/llms/pages/designer.md +79 -0
- package/data/llms/pages/dynamicimports.md +7 -0
- package/data/llms/pages/forms.md +63 -0
- package/data/llms/pages/guides/accessibility.md +27 -0
- package/data/llms/pages/guides/animations.md +119 -0
- package/data/llms/pages/guides/rtl.md +7 -0
- package/data/llms/pages/icons.md +136 -0
- package/data/llms/pages/installation.md +3 -0
- package/data/llms/pages/introduction.md +23 -0
- package/data/llms/pages/laravel.md +66 -0
- package/data/llms/pages/llms.md +15 -0
- package/data/llms/pages/mcp.md +104 -0
- package/data/llms/pages/migration/v4.md +15 -0
- package/data/llms/pages/migration/v5.md +15 -0
- package/data/llms/pages/nuxt.md +141 -0
- package/data/llms/pages/passthrough.md +137 -0
- package/data/llms/pages/primeclt.md +43 -0
- package/data/llms/pages/rtl.md +7 -0
- package/data/llms/pages/setup.md +3 -0
- package/data/llms/pages/styled.md +497 -0
- package/data/llms/pages/tailwind.md +151 -0
- package/data/llms/pages/theming/styled.md +497 -0
- package/data/llms/pages/theming/unstyled.md +57 -0
- package/data/llms/pages/uikit.md +3 -0
- package/data/llms/pages/unstyled.md +57 -0
- package/data/llms/pages/v4.md +15 -0
- package/data/llms/pages/v5.md +15 -0
- package/data/llms/pages/vite.md +90 -0
- package/data/manifest.json +11117 -0
- package/data/mcp-data.json +55940 -0
- package/dist/index.d.ts +17 -1
- package/dist/index.js +66066 -72541
- package/package.json +10 -12
|
@@ -0,0 +1,312 @@
|
|
|
1
|
+
# Rating
|
|
2
|
+
|
|
3
|
+
Rating component is a star based selection input.
|
|
4
|
+
|
|
5
|
+
## Basic
|
|
6
|
+
|
|
7
|
+
Two-way value binding is defined using v-model .
|
|
8
|
+
|
|
9
|
+
```vue
|
|
10
|
+
<template>
|
|
11
|
+
<div class="flex justify-center">
|
|
12
|
+
<Rating v-model="value" />
|
|
13
|
+
</div>
|
|
14
|
+
</template>
|
|
15
|
+
|
|
16
|
+
<script setup>
|
|
17
|
+
import { ref } from 'vue';
|
|
18
|
+
|
|
19
|
+
const value = ref(3);
|
|
20
|
+
<\/script>
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Half Stars
|
|
24
|
+
|
|
25
|
+
Enable allowHalf property to select half stars.
|
|
26
|
+
|
|
27
|
+
```vue
|
|
28
|
+
<template>
|
|
29
|
+
<div class="flex flex-col gap-6 items-center justify-center">
|
|
30
|
+
<div class="flex flex-col gap-2">
|
|
31
|
+
<Label>Full Star</Label>
|
|
32
|
+
<Rating v-model="value1" />
|
|
33
|
+
</div>
|
|
34
|
+
<div class="flex flex-col gap-2">
|
|
35
|
+
<Label>Half Star</Label>
|
|
36
|
+
<Rating v-model="value2" allowHalf />
|
|
37
|
+
</div>
|
|
38
|
+
</div>
|
|
39
|
+
</template>
|
|
40
|
+
|
|
41
|
+
<script setup>
|
|
42
|
+
import { ref } from 'vue';
|
|
43
|
+
|
|
44
|
+
const value1 = ref(3);
|
|
45
|
+
const value2 = ref(3);
|
|
46
|
+
<\/script>
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
## Controlled
|
|
50
|
+
|
|
51
|
+
Rating value can be controlled programmatically.
|
|
52
|
+
|
|
53
|
+
```vue
|
|
54
|
+
<template>
|
|
55
|
+
<div class="flex flex-col items-center justify-center gap-6">
|
|
56
|
+
<Rating v-model="value" allowHalf />
|
|
57
|
+
<div class="flex items-center gap-2">
|
|
58
|
+
<Button @click="value = 2.5" severity="secondary" variant="outlined" size="small">2.5 Star</Button>
|
|
59
|
+
<Button @click="value = 3" severity="secondary" variant="outlined" size="small">3 Star</Button>
|
|
60
|
+
<Button @click="value = 3.5" severity="secondary" variant="outlined" size="small">3.5 Star</Button>
|
|
61
|
+
</div>
|
|
62
|
+
</div>
|
|
63
|
+
</template>
|
|
64
|
+
|
|
65
|
+
<script setup>
|
|
66
|
+
import { ref } from 'vue';
|
|
67
|
+
|
|
68
|
+
const value = ref(4);
|
|
69
|
+
<\/script>
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
## Number of Stars
|
|
73
|
+
|
|
74
|
+
Number of stars to display is defined with stars property.
|
|
75
|
+
|
|
76
|
+
```vue
|
|
77
|
+
<template>
|
|
78
|
+
<div class="flex justify-center">
|
|
79
|
+
<Rating v-model="value" :stars="10" />
|
|
80
|
+
</div>
|
|
81
|
+
</template>
|
|
82
|
+
|
|
83
|
+
<script setup>
|
|
84
|
+
import { ref } from 'vue';
|
|
85
|
+
|
|
86
|
+
const value = ref(5);
|
|
87
|
+
<\/script>
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
## Vertical
|
|
91
|
+
|
|
92
|
+
Rating can be displayed vertically by setting the orientation property to vertical .
|
|
93
|
+
|
|
94
|
+
```vue
|
|
95
|
+
<template>
|
|
96
|
+
<div class="flex justify-center">
|
|
97
|
+
<Rating v-model="value" orientation="vertical" />
|
|
98
|
+
</div>
|
|
99
|
+
</template>
|
|
100
|
+
|
|
101
|
+
<script setup>
|
|
102
|
+
import { ref } from 'vue';
|
|
103
|
+
|
|
104
|
+
const value = ref(3);
|
|
105
|
+
<\/script>
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
## Template
|
|
109
|
+
|
|
110
|
+
Templating allows customizing the content where the icon instance is available as the implicit variable.
|
|
111
|
+
|
|
112
|
+
```vue
|
|
113
|
+
<template>
|
|
114
|
+
<div class="flex flex-col items-center justify-center gap-6">
|
|
115
|
+
<Rating v-model="value1" allowHalf>
|
|
116
|
+
<template #onicon>
|
|
117
|
+
<span class="text-surface-950 dark:text-surface-0 font-medium text-4xl select-none">A</span>
|
|
118
|
+
</template>
|
|
119
|
+
<template #officon>
|
|
120
|
+
<span class="text-surface-300 dark:text-surface-700 font-medium text-4xl select-none">A</span>
|
|
121
|
+
</template>
|
|
122
|
+
</Rating>
|
|
123
|
+
<Rating v-model="value2">
|
|
124
|
+
<template #onicon>
|
|
125
|
+
<span class="size-7">
|
|
126
|
+
<img src="https://primefaces.org/cdn/primevue/images/rating/custom-onicon.png" class="size-7" />
|
|
127
|
+
</span>
|
|
128
|
+
</template>
|
|
129
|
+
<template #officon>
|
|
130
|
+
<span class="size-7">
|
|
131
|
+
<img src="https://primefaces.org/cdn/primevue/images/rating/custom-officon.png" class="size-7" />
|
|
132
|
+
</span>
|
|
133
|
+
</template>
|
|
134
|
+
</Rating>
|
|
135
|
+
</div>
|
|
136
|
+
</template>
|
|
137
|
+
|
|
138
|
+
<script setup>
|
|
139
|
+
import { ref } from 'vue';
|
|
140
|
+
|
|
141
|
+
const value1 = ref(3);
|
|
142
|
+
const value2 = ref(3);
|
|
143
|
+
<\/script>
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
## Emoji
|
|
147
|
+
|
|
148
|
+
Custom content can be used for rating icons using templates.
|
|
149
|
+
|
|
150
|
+
```vue
|
|
151
|
+
<template>
|
|
152
|
+
<div class="flex justify-center">
|
|
153
|
+
<Rating v-model="value" :stars="5">
|
|
154
|
+
<template #onicon="{ value: index }">
|
|
155
|
+
<span class="text-4xl select-none transition-all">{{ emojis[index - 1] }}</span>
|
|
156
|
+
</template>
|
|
157
|
+
<template #officon="{ value: index }">
|
|
158
|
+
<span class="text-4xl select-none transition-all grayscale">{{ emojis[index - 1] }}</span>
|
|
159
|
+
</template>
|
|
160
|
+
</Rating>
|
|
161
|
+
</div>
|
|
162
|
+
</template>
|
|
163
|
+
|
|
164
|
+
<script setup>
|
|
165
|
+
import { ref } from 'vue';
|
|
166
|
+
|
|
167
|
+
const value = ref(3);
|
|
168
|
+
const emojis = ref(['😡', '😕', '😐', '🙂', '😍']);
|
|
169
|
+
<\/script>
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
## ReadOnly
|
|
173
|
+
|
|
174
|
+
When readonly present, value cannot be edited.
|
|
175
|
+
|
|
176
|
+
```vue
|
|
177
|
+
<template>
|
|
178
|
+
<div class="flex justify-center">
|
|
179
|
+
<Rating v-model="value" readonly />
|
|
180
|
+
</div>
|
|
181
|
+
</template>
|
|
182
|
+
|
|
183
|
+
<script setup>
|
|
184
|
+
import { ref } from 'vue';
|
|
185
|
+
|
|
186
|
+
const value = ref(3);
|
|
187
|
+
<\/script>
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
## Disabled
|
|
191
|
+
|
|
192
|
+
When disabled is present, a visual hint is applied to indicate that the Rating cannot be interacted with.
|
|
193
|
+
|
|
194
|
+
```vue
|
|
195
|
+
<template>
|
|
196
|
+
<div class="flex justify-center">
|
|
197
|
+
<Rating v-model="value" disabled />
|
|
198
|
+
</div>
|
|
199
|
+
</template>
|
|
200
|
+
|
|
201
|
+
<script setup>
|
|
202
|
+
import { ref } from 'vue';
|
|
203
|
+
|
|
204
|
+
const value = ref(3);
|
|
205
|
+
<\/script>
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
## Forms
|
|
209
|
+
|
|
210
|
+
Rating integrates seamlessly with the PrimeVue Forms library.
|
|
211
|
+
|
|
212
|
+
```vue
|
|
213
|
+
<template>
|
|
214
|
+
<div class="flex justify-center">
|
|
215
|
+
<Form v-slot="$form" :resolver="resolver" :initialValues="initialValues" @submit="onFormSubmit" class="flex flex-col gap-4 w-40">
|
|
216
|
+
<div class="flex flex-col items-center gap-2">
|
|
217
|
+
<Rating name="rating" />
|
|
218
|
+
<Message v-if="$form.rating?.invalid" severity="error" size="small" variant="simple">{{ $form.rating.error?.message }}</Message>
|
|
219
|
+
</div>
|
|
220
|
+
<Button type="submit" severity="secondary">Submit</Button>
|
|
221
|
+
</Form>
|
|
222
|
+
</div>
|
|
223
|
+
</template>
|
|
224
|
+
|
|
225
|
+
<script setup>
|
|
226
|
+
import { ref } from 'vue';
|
|
227
|
+
import { zodResolver } from '@primevue/forms/resolvers/zod';
|
|
228
|
+
import { useToast } from "primevue/usetoast";
|
|
229
|
+
import { z } from 'zod';
|
|
230
|
+
|
|
231
|
+
const toast = useToast();
|
|
232
|
+
const initialValues = ref({
|
|
233
|
+
rating: null
|
|
234
|
+
});
|
|
235
|
+
const resolver = ref(zodResolver(
|
|
236
|
+
z.object({
|
|
237
|
+
rating: z.union([z.number(), z.literal(null)]).refine((value) => value !== null, { message: 'Rating is required.' })
|
|
238
|
+
})
|
|
239
|
+
));
|
|
240
|
+
|
|
241
|
+
const onFormSubmit = ({ valid }) => {
|
|
242
|
+
if (valid) {
|
|
243
|
+
toast.add({ severity: 'success', summary: 'Form is submitted.', life: 3000 });
|
|
244
|
+
}
|
|
245
|
+
};
|
|
246
|
+
<\/script>
|
|
247
|
+
```
|
|
248
|
+
|
|
249
|
+
## Accessibility
|
|
250
|
+
|
|
251
|
+
Screen Reader Rating component internally uses radio buttons that are only visible to screen readers. The value to read for item is retrieved from the locale API via star and stars of the aria property. Keyboard Support Keyboard interaction is derived from the native browser handling of radio buttons in a group. Key Function tab Moves focus to the star representing the value, if there is none then first star receives the focus. left arrow up arrow Moves focus to the previous star, if there is none then last radio button receives the focus. right arrow down arrow Moves focus to the next star, if there is none then first star receives the focus. space If the focused star does not represent the value, changes the value to the star value.
|
|
252
|
+
|
|
253
|
+
## Rating API
|
|
254
|
+
|
|
255
|
+
### Props
|
|
256
|
+
|
|
257
|
+
| Name |Type |Default |Description |
|
|
258
|
+
| --- | --- | --- | --- |
|
|
259
|
+
| modelValue | null \| number | - | Value of the rating. |
|
|
260
|
+
| defaultValue | null \| number | - | The default value for the input when not controlled by `modelValue` . |
|
|
261
|
+
| name | string | - | Name of the element. |
|
|
262
|
+
| disabled | boolean | false | When present, it specifies that the element should be disabled. |
|
|
263
|
+
| readonly | boolean | false | When present, it specifies that component is read-only. |
|
|
264
|
+
| stars | number | 5 | Number of stars. |
|
|
265
|
+
| allowHalf | boolean | false | When enabled, allows half-value selection (e.g. 1.5, 2.5). Each star renders an additional sr-only radio input for the half value. |
|
|
266
|
+
| orientation | "horizontal" \| "vertical" | 'horizontal' | Layout orientation of the stars. |
|
|
267
|
+
| onIcon | string | - | Icon for the on state. |
|
|
268
|
+
| offIcon | string | - | Icon for the off state. |
|
|
269
|
+
| formControl | Record<string, any> | - | Form control object, typically used for handling validation and form state. |
|
|
270
|
+
| dt | any | - | It generates scoped CSS variables using design tokens for the component. |
|
|
271
|
+
| pt | PassThrough<RatingPassThroughOptions> | - | Used to pass attributes to DOM elements inside the component. |
|
|
272
|
+
| ptOptions | any | - | Used to configure passthrough(pt) options of the component. |
|
|
273
|
+
| unstyled | boolean | false | When enabled, it removes component related styles in the core. |
|
|
274
|
+
|
|
275
|
+
### Pass Through Options
|
|
276
|
+
|
|
277
|
+
| Name |Type |Description |
|
|
278
|
+
| --- | --- | --- |
|
|
279
|
+
| root | RatingPassThroughOptionType | Used to pass attributes to the root's DOM element. |
|
|
280
|
+
| option | RatingPassThroughOptionType | Used to pass attributes to the option's DOM element. |
|
|
281
|
+
| onIcon | RatingPassThroughOptionType | Used to pass attributes to the on icon's DOM element. |
|
|
282
|
+
| offIcon | RatingPassThroughOptionType | Used to pass attributes to the off icon's DOM element. |
|
|
283
|
+
| halfInput | RatingPassThroughOptionType | Used to pass attributes to the half-value hidden radio input element (only rendered when `allowHalf` is true). |
|
|
284
|
+
| fullInput | RatingPassThroughOptionType | Used to pass attributes to the full-value hidden radio input element. |
|
|
285
|
+
| hooks | any | Used to manage all lifecycle hooks. |
|
|
286
|
+
|
|
287
|
+
### Theming
|
|
288
|
+
|
|
289
|
+
### CSS Classes
|
|
290
|
+
|
|
291
|
+
| Class |Description |
|
|
292
|
+
| --- | --- |
|
|
293
|
+
| p-rating | Class name of the root element |
|
|
294
|
+
| p-rating-option | Class name of the option element |
|
|
295
|
+
| p-rating-on-icon | Class name of the on icon element |
|
|
296
|
+
| p-rating-off-icon | Class name of the off icon element |
|
|
297
|
+
|
|
298
|
+
### Design Tokens
|
|
299
|
+
|
|
300
|
+
| Token |CSS Variable |Description |
|
|
301
|
+
| --- | --- | --- |
|
|
302
|
+
| rating.gap | --p-rating-gap | Gap of root |
|
|
303
|
+
| rating.transition.duration | --p-rating-transition-duration | Transition duration of root |
|
|
304
|
+
| rating.focus.ring.width | --p-rating-focus-ring-width | Focus ring width of root |
|
|
305
|
+
| rating.focus.ring.style | --p-rating-focus-ring-style | Focus ring style of root |
|
|
306
|
+
| rating.focus.ring.color | --p-rating-focus-ring-color | Focus ring color of root |
|
|
307
|
+
| rating.focus.ring.offset | --p-rating-focus-ring-offset | Focus ring offset of root |
|
|
308
|
+
| rating.focus.ring.shadow | --p-rating-focus-ring-shadow | Focus ring shadow of root |
|
|
309
|
+
| rating.icon.size | --p-rating-icon-size | Size of icon |
|
|
310
|
+
| rating.icon.color | --p-rating-icon-color | Color of icon |
|
|
311
|
+
| rating.icon.hover.color | --p-rating-icon-hover-color | Hover color of icon |
|
|
312
|
+
| rating.icon.active.color | --p-rating-icon-active-color | Active color of icon |
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
# Ripple
|
|
2
|
+
|
|
3
|
+
Ripple directive adds ripple effect to the host element.
|
|
4
|
+
|
|
5
|
+
## Configuration
|
|
6
|
+
|
|
7
|
+
To start with, Ripple needs to be enabled globally. See the Configuration API for details.
|
|
8
|
+
|
|
9
|
+
```vue
|
|
10
|
+
mounted() {
|
|
11
|
+
this.$primevue.config.ripple = true;
|
|
12
|
+
}
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Default
|
|
16
|
+
|
|
17
|
+
Ripple is enabled by adding the v-ripple directive to the host element.
|
|
18
|
+
|
|
19
|
+
```vue
|
|
20
|
+
<template>
|
|
21
|
+
<div class="flex flex-col items-center gap-4">
|
|
22
|
+
<div v-ripple class="ripple-box">Default</div>
|
|
23
|
+
</div>
|
|
24
|
+
</template>
|
|
25
|
+
|
|
26
|
+
<style scoped>
|
|
27
|
+
.ripple-box {
|
|
28
|
+
display: flex;
|
|
29
|
+
user-select: none;
|
|
30
|
+
justify-content: center;
|
|
31
|
+
align-items: center;
|
|
32
|
+
padding: 2.625rem;
|
|
33
|
+
font-weight: bold;
|
|
34
|
+
font-size: 0.875rem;
|
|
35
|
+
background: var(--p-content-background);
|
|
36
|
+
border: 1px solid var(--p-content-border-color);
|
|
37
|
+
border-radius: var(--p-content-border-radius);
|
|
38
|
+
}
|
|
39
|
+
<\/style>
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## Custom
|
|
43
|
+
|
|
44
|
+
Default styling of the animation adds a shade of white. This can easily be customized using css that changes the color of p-ink element.
|
|
45
|
+
|
|
46
|
+
```vue
|
|
47
|
+
<template>
|
|
48
|
+
<div class="flex justify-center gap-2">
|
|
49
|
+
<div v-ripple class="box" style="border: 1px solid rgba(75, 175, 80, 0.3); --p-ripple-background: rgba(75, 175, 80, 0.3)">Green</div>
|
|
50
|
+
<div v-ripple class="box" style="border: 1px solid rgba(255, 193, 6, 0.3); --p-ripple-background: rgba(255, 193, 6, 0.3)">Orange</div>
|
|
51
|
+
<div v-ripple class="box" style="border: 1px solid rgba(156, 39, 176, 0.3); --p-ripple-background: rgba(156, 39, 176, 0.3)">Purple</div>
|
|
52
|
+
</div>
|
|
53
|
+
</template>
|
|
54
|
+
|
|
55
|
+
<style scoped>
|
|
56
|
+
.box {
|
|
57
|
+
padding: 1.75rem;
|
|
58
|
+
border-radius: 10px;
|
|
59
|
+
font-size: 0.875rem;
|
|
60
|
+
width: 110px;
|
|
61
|
+
text-align: center;
|
|
62
|
+
}
|
|
63
|
+
<\/style>
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
## Accessibility
|
|
67
|
+
|
|
68
|
+
Screen Reader Ripple element has the aria-hidden attribute as true so that it gets ignored by the screen readers. Keyboard Support Component does not include any interactive elements.
|
|
69
|
+
|
|
70
|
+
## Ripple API
|
|
71
|
+
|
|
72
|
+
### Pass Through Options
|
|
73
|
+
|
|
74
|
+
| Name |Type |Description |
|
|
75
|
+
| --- | --- | --- |
|
|
76
|
+
| root | RippleDirectivePassThroughOptionType | Used to pass attributes to the root's DOM element. |
|
|
77
|
+
| hooks | any | Used to manage all lifecycle hooks. |
|
|
78
|
+
|
|
79
|
+
### Theming
|
|
80
|
+
|
|
81
|
+
### CSS Classes
|
|
82
|
+
|
|
83
|
+
| Class |Description |
|
|
84
|
+
| --- | --- |
|
|
85
|
+
| p-ink | Class name of the root element |
|
|
86
|
+
|
|
87
|
+
### Design Tokens
|
|
88
|
+
|
|
89
|
+
| Token |CSS Variable |Description |
|
|
90
|
+
| --- | --- | --- |
|
|
91
|
+
| ripple.background | --p-ripple-background | Background of root |
|