@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,407 @@
|
|
|
1
|
+
# Compare
|
|
2
|
+
|
|
3
|
+
Compare two items side by side with a slider.
|
|
4
|
+
|
|
5
|
+
## Basic
|
|
6
|
+
|
|
7
|
+
Compare is composed with Compare as the root, two CompareItem layers, and a CompareHandle containing the keyboard-accessible CompareIndicator .
|
|
8
|
+
|
|
9
|
+
```vue
|
|
10
|
+
<template>
|
|
11
|
+
<Compare class="aspect-video w-full max-w-lg">
|
|
12
|
+
<CompareItem position="before">
|
|
13
|
+
<img src="https://primefaces.org/cdn/primevue/images/compare/island2.jpg" alt="Before" />
|
|
14
|
+
</CompareItem>
|
|
15
|
+
<CompareItem position="after">
|
|
16
|
+
<img src="https://primefaces.org/cdn/primevue/images/compare/island1.jpg" alt="After" />
|
|
17
|
+
</CompareItem>
|
|
18
|
+
<CompareHandle>
|
|
19
|
+
<CompareIndicator class="group flex items-center justify-center">
|
|
20
|
+
<ArrowsH class="group-data-[orientation=vertical]:rotate-90" />
|
|
21
|
+
</CompareIndicator>
|
|
22
|
+
</CompareHandle>
|
|
23
|
+
</Compare>
|
|
24
|
+
</template>
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Custom Handle
|
|
28
|
+
|
|
29
|
+
The handle can be styled freely — give the indicator a rounded background, custom icon, and shadow for a more prominent look.
|
|
30
|
+
|
|
31
|
+
```vue
|
|
32
|
+
<template>
|
|
33
|
+
<Compare class="aspect-video max-w-lg mx-auto">
|
|
34
|
+
<CompareItem position="before">
|
|
35
|
+
<img src="https://primefaces.org/cdn/primevue/images/compare/island2.jpg" />
|
|
36
|
+
</CompareItem>
|
|
37
|
+
<CompareItem position="after">
|
|
38
|
+
<img src="https://primefaces.org/cdn/primevue/images/compare/island1.jpg" />
|
|
39
|
+
</CompareItem>
|
|
40
|
+
<CompareHandle class="bg-transparent!">
|
|
41
|
+
<CompareIndicator class="size-5! rounded-full! bg-white/50! transition-transform duration-200! hover:transform-[translate(-50%,-50%)_scale(1.5)]!" />
|
|
42
|
+
</CompareHandle>
|
|
43
|
+
</Compare>
|
|
44
|
+
</template>
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## Hover
|
|
48
|
+
|
|
49
|
+
Enable slideOnHover to update the slider position by hovering over the component.
|
|
50
|
+
|
|
51
|
+
```vue
|
|
52
|
+
<template>
|
|
53
|
+
<Compare class="aspect-video max-w-lg mx-auto" slideOnHover>
|
|
54
|
+
<CompareItem position="before">
|
|
55
|
+
<img src="https://primefaces.org/cdn/primevue/images/compare/island2.jpg" />
|
|
56
|
+
</CompareItem>
|
|
57
|
+
<CompareItem position="after">
|
|
58
|
+
<img src="https://primefaces.org/cdn/primevue/images/compare/island1.jpg" />
|
|
59
|
+
</CompareItem>
|
|
60
|
+
<CompareHandle>
|
|
61
|
+
<CompareIndicator class="group flex items-center justify-center">
|
|
62
|
+
<Code class="group-data-[orientation=vertical]:rotate-90" />
|
|
63
|
+
</CompareIndicator>
|
|
64
|
+
</CompareHandle>
|
|
65
|
+
</Compare>
|
|
66
|
+
</template>
|
|
67
|
+
|
|
68
|
+
<script setup>
|
|
69
|
+
import Code from '@primeicons/vue/code';
|
|
70
|
+
<\/script>
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
## Vertical
|
|
74
|
+
|
|
75
|
+
Set orientation to vertical for a vertical comparison layout.
|
|
76
|
+
|
|
77
|
+
```vue
|
|
78
|
+
<template>
|
|
79
|
+
<Compare class="aspect-video max-w-lg mx-auto" orientation="vertical">
|
|
80
|
+
<CompareItem position="before">
|
|
81
|
+
<img src="https://primefaces.org/cdn/primevue/images/compare/island2.jpg" />
|
|
82
|
+
</CompareItem>
|
|
83
|
+
<CompareItem position="after">
|
|
84
|
+
<img src="https://primefaces.org/cdn/primevue/images/compare/island1.jpg" />
|
|
85
|
+
</CompareItem>
|
|
86
|
+
<CompareHandle>
|
|
87
|
+
<CompareIndicator class="group flex items-center justify-center">
|
|
88
|
+
<Code class="group-data-[orientation=vertical]:rotate-90" />
|
|
89
|
+
</CompareIndicator>
|
|
90
|
+
</CompareHandle>
|
|
91
|
+
</Compare>
|
|
92
|
+
</template>
|
|
93
|
+
|
|
94
|
+
<script setup>
|
|
95
|
+
import Code from '@primeicons/vue/code';
|
|
96
|
+
<\/script>
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
## With Chart
|
|
100
|
+
|
|
101
|
+
Combine slideOnHover with controlled value for interactive chart reveals.
|
|
102
|
+
|
|
103
|
+
```vue
|
|
104
|
+
<template>
|
|
105
|
+
<Compare v-model="value" class="aspect-video max-w-lg mx-auto" slideOnHover>
|
|
106
|
+
<CompareItem position="before">
|
|
107
|
+
<svg class="absolute h-full w-full" viewBox="0 0 644 189" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
108
|
+
<g clip-path="url(#compare_chart_clip)">
|
|
109
|
+
<path
|
|
110
|
+
d="M0.5 118.499C0.5 118.499 82 102.999 113.5 89.4989C145 75.9989 188.444 87.7869 235 77.4989C272.684 69.1719 293.654 62.4939 329 46.9989C409.332 11.7849 479.5 86.5 510.5 78C541.5 69.5 635.951 0.848863 644 1.49886"
|
|
111
|
+
stroke="var(--p-primary-color)"
|
|
112
|
+
stroke-width="2"
|
|
113
|
+
/>
|
|
114
|
+
<path
|
|
115
|
+
d="M113.5 89.5006C82 103.001 0.5 118.501 0.5 118.501V188.501H644V1.50065C635.951 0.850647 541.5 69.5 510.5 78C479.5 86.5 409.332 11.7866 329 47.0006C293.654 62.4956 272.684 69.1736 235 77.5006C188.444 87.7886 145 76.0006 113.5 89.5006Z"
|
|
116
|
+
fill="url(#compare_chart_gradient)"
|
|
117
|
+
/>
|
|
118
|
+
</g>
|
|
119
|
+
<defs>
|
|
120
|
+
<clipPath id="compare_chart_clip">
|
|
121
|
+
<rect width="644" height="189" fill="white" />
|
|
122
|
+
</clipPath>
|
|
123
|
+
<linearGradient id="compare_chart_gradient" x1="322.25" x2="322.25" y1="1.477" y2="188.5" gradientUnits="userSpaceOnUse">
|
|
124
|
+
<stop stop-color="var(--p-primary-color)" stop-opacity="0.4" />
|
|
125
|
+
<stop offset="1" stop-color="var(--p-primary-color)" stop-opacity="0" />
|
|
126
|
+
</linearGradient>
|
|
127
|
+
</defs>
|
|
128
|
+
</svg>
|
|
129
|
+
</CompareItem>
|
|
130
|
+
</Compare>
|
|
131
|
+
</template>
|
|
132
|
+
|
|
133
|
+
<script setup>
|
|
134
|
+
import { ref } from 'vue';
|
|
135
|
+
|
|
136
|
+
const value = ref(50);
|
|
137
|
+
<\/script>
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
## Controlled
|
|
141
|
+
|
|
142
|
+
Bind the value with v-model when external UI needs to stay in sync with the slider.
|
|
143
|
+
|
|
144
|
+
```vue
|
|
145
|
+
<template>
|
|
146
|
+
<Compare v-model="value" class="aspect-video w-full max-w-lg" aria-label="Compare images">
|
|
147
|
+
<CompareItem position="before">
|
|
148
|
+
<img src="https://primefaces.org/cdn/primevue/images/compare/island2.jpg" alt="Before" />
|
|
149
|
+
</CompareItem>
|
|
150
|
+
<CompareItem position="after">
|
|
151
|
+
<img src="https://primefaces.org/cdn/primevue/images/compare/island1.jpg" alt="After" />
|
|
152
|
+
</CompareItem>
|
|
153
|
+
<CompareHandle>
|
|
154
|
+
<CompareIndicator class="flex items-center justify-center">
|
|
155
|
+
<ArrowsH />
|
|
156
|
+
</CompareIndicator>
|
|
157
|
+
</CompareHandle>
|
|
158
|
+
</Compare>
|
|
159
|
+
<div class="flex w-full max-w-lg items-center justify-between gap-4">
|
|
160
|
+
<Button severity="secondary" outlined @click="value = 25">25%</Button>
|
|
161
|
+
<InputNumber v-model="value" inputClass="w-20 text-center" :min="0" :max="100" suffix="%" />
|
|
162
|
+
<Button severity="secondary" outlined @click="value = 75">75%</Button>
|
|
163
|
+
</div>
|
|
164
|
+
</template>
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
## Template
|
|
168
|
+
|
|
169
|
+
Compare is not limited to images — any content can be placed inside the items for creative comparisons.
|
|
170
|
+
|
|
171
|
+
```vue
|
|
172
|
+
<template>
|
|
173
|
+
<Compare class="relative w-full max-w-md mx-auto h-[320px]">
|
|
174
|
+
<CompareItem position="before">
|
|
175
|
+
<div class="size-full bg-purple-100 dark:bg-purple-900/50 p-6 flex items-center justify-center">
|
|
176
|
+
<div class="w-full max-w-xs rounded-xl border bg-white dark:bg-purple-900 border-purple-100 dark:border-purple-800 p-5 space-y-4">
|
|
177
|
+
<div class="flex items-start justify-between">
|
|
178
|
+
<div class="flex items-center gap-3">
|
|
179
|
+
<Avatar shape="circle" class="w-10 h-10">
|
|
180
|
+
<img class="filter hue-rotate-[260deg] saturate-150" src="https://primefaces.org/cdn/primevue/images/avatar/amyelsner.png" />
|
|
181
|
+
</Avatar>
|
|
182
|
+
<div>
|
|
183
|
+
<div class="font-medium text-purple-950 dark:text-purple-50">Amy Elsner</div>
|
|
184
|
+
<div class="text-sm text-purple-600 dark:text-purple-400">Developer</div>
|
|
185
|
+
</div>
|
|
186
|
+
</div>
|
|
187
|
+
<Tag class="bg-purple-100 dark:bg-purple-800 text-purple-700 dark:text-purple-200">Pro</Tag>
|
|
188
|
+
</div>
|
|
189
|
+
<div class="space-y-2">
|
|
190
|
+
<div class="flex justify-between text-sm">
|
|
191
|
+
<span class="text-purple-600 dark:text-purple-400">Storage</span>
|
|
192
|
+
<span class="text-purple-950 dark:text-purple-50">7.2 GB / 10 GB</span>
|
|
193
|
+
</div>
|
|
194
|
+
<ProgressBar :value="72" :showValue="false" class="h-2 [&_.p-progressbar-indicator]:bg-purple-500 [&_.p-progressbar-track]:bg-purple-100 dark:[&_.p-progressbar-track]:bg-purple-800" />
|
|
195
|
+
</div>
|
|
196
|
+
<div class="flex gap-2 pt-2">
|
|
197
|
+
<Button severity="help" class="flex-1">Upgrade</Button>
|
|
198
|
+
<Button severity="help" variant="outlined">Settings</Button>
|
|
199
|
+
</div>
|
|
200
|
+
</div>
|
|
201
|
+
</div>
|
|
202
|
+
</CompareItem>
|
|
203
|
+
<CompareItem position="after">
|
|
204
|
+
<div class="size-full bg-primary-100 dark:bg-primary-900/50 p-6 flex items-center justify-center">
|
|
205
|
+
<div class="w-full max-w-xs rounded-xl border bg-white dark:bg-primary-900 border-primary-100 dark:border-primary-800 p-5 space-y-4">
|
|
206
|
+
<div class="flex items-start justify-between">
|
|
207
|
+
<div class="flex items-center gap-3">
|
|
208
|
+
<Avatar shape="circle" class="w-10 h-10">
|
|
209
|
+
<img src="https://primefaces.org/cdn/primevue/images/avatar/amyelsner.png" />
|
|
210
|
+
</Avatar>
|
|
211
|
+
<div>
|
|
212
|
+
<div class="font-medium text-primary-950 dark:text-primary-50">Amy Elsner</div>
|
|
213
|
+
<div class="text-sm text-primary-600 dark:text-primary-400">Developer</div>
|
|
214
|
+
</div>
|
|
215
|
+
</div>
|
|
216
|
+
<Tag class="bg-primary-100 dark:bg-primary-800 text-primary-700 dark:text-primary-200">Pro</Tag>
|
|
217
|
+
</div>
|
|
218
|
+
<div class="space-y-2">
|
|
219
|
+
<div class="flex justify-between text-sm">
|
|
220
|
+
<span class="text-primary-600 dark:text-primary-400">Storage</span>
|
|
221
|
+
<span class="text-primary-950 dark:text-primary-50">7.2 GB / 10 GB</span>
|
|
222
|
+
</div>
|
|
223
|
+
<ProgressBar :value="72" :showValue="false" class="h-2 [&_.p-progressbar-indicator]:bg-primary [&_.p-progressbar-track]:bg-primary-100 dark:[&_.p-progressbar-track]:bg-primary-800" />
|
|
224
|
+
</div>
|
|
225
|
+
<div class="flex gap-2 pt-2">
|
|
226
|
+
<Button class="flex-1">Upgrade</Button>
|
|
227
|
+
<Button variant="outlined">Settings</Button>
|
|
228
|
+
</div>
|
|
229
|
+
</div>
|
|
230
|
+
</div>
|
|
231
|
+
</CompareItem>
|
|
232
|
+
<CompareHandle>
|
|
233
|
+
<CompareIndicator class="group flex items-center justify-center border border-surface">
|
|
234
|
+
<Code class="group-data-[orientation=vertical]:rotate-90" />
|
|
235
|
+
</CompareIndicator>
|
|
236
|
+
</CompareHandle>
|
|
237
|
+
</Compare>
|
|
238
|
+
</template>
|
|
239
|
+
|
|
240
|
+
<script setup>
|
|
241
|
+
import Code from '@primeicons/vue/code';
|
|
242
|
+
<\/script>
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
## Accessibility
|
|
246
|
+
|
|
247
|
+
Screen Reader Compare uses a hidden range input for keyboard accessibility. The input supports aria-label , aria-labelledby , aria-valuemin , aria-valuemax , and aria-valuenow attributes. Use arrow keys to adjust the slider position. Keyboard Support Key Function tab Moves focus to the component. left arrow up arrow Decrements the value. right arrow down arrow Increments the value. home Set the minimum value. end Set the maximum value. page up Increments the value by a browser-defined larger step (approximately 10% of the range). page down Decrements the value by a browser-defined larger step (approximately 10% of the range).
|
|
248
|
+
|
|
249
|
+
```vue
|
|
250
|
+
<template>
|
|
251
|
+
<span id="compare_label">Compare Images</span>
|
|
252
|
+
<Compare aria-labelledby="compare_label">...</Compare>
|
|
253
|
+
|
|
254
|
+
<Compare aria-label="Compare Images">...</Compare>
|
|
255
|
+
</template>
|
|
256
|
+
```
|
|
257
|
+
|
|
258
|
+
## Compare API
|
|
259
|
+
|
|
260
|
+
### Props
|
|
261
|
+
|
|
262
|
+
| Name |Type |Default |Description |
|
|
263
|
+
| --- | --- | --- | --- |
|
|
264
|
+
| modelValue | number | - | Value of the component. Pair with `v-model` for two-way binding. |
|
|
265
|
+
| min | number | 0 | Minimum boundary value. |
|
|
266
|
+
| max | number | 100 | Maximum boundary value. |
|
|
267
|
+
| step | number | 1 | Step factor to increment/decrement the value. |
|
|
268
|
+
| orientation | "horizontal" \| "vertical" | horizontal | Orientation of the compare slider. |
|
|
269
|
+
| slideOnHover | boolean | false | Whether the slider moves on hover. |
|
|
270
|
+
| disabled | boolean | false | Whether the component is disabled. |
|
|
271
|
+
| readonly | boolean | false | Whether the component is read-only. |
|
|
272
|
+
| invalid | boolean | false | When present, it specifies that the component should be invalid. |
|
|
273
|
+
| tabindex | number | - | The tab index of the hidden range input. |
|
|
274
|
+
| ariaLabel | string | - | Establishes a string value that labels the component. |
|
|
275
|
+
| ariaLabelledby | string | - | Establishes relationships between the component and label(s). |
|
|
276
|
+
| name | string | - | Name of the hidden input. |
|
|
277
|
+
| as | string \| Component | DIV | Use to change the HTML tag of root element. |
|
|
278
|
+
| asChild | boolean | false | When enabled, it changes the default rendered element for the one passed as a child element. |
|
|
279
|
+
| dt | any | - | It generates scoped CSS variables using design tokens for the component. |
|
|
280
|
+
| pt | PassThrough<ComparePassThroughOptions> | - | Used to pass attributes to DOM elements inside the component. |
|
|
281
|
+
| ptOptions | any | - | Used to configure passthrough(pt) options of the component. |
|
|
282
|
+
| unstyled | boolean | false | When enabled, it removes component related styles in the core. |
|
|
283
|
+
|
|
284
|
+
### Pass Through Options
|
|
285
|
+
|
|
286
|
+
| Name |Type |Description |
|
|
287
|
+
| --- | --- | --- |
|
|
288
|
+
| root | ComparePassThroughOptionType | Used to pass attributes to the root's DOM element. |
|
|
289
|
+
| item | ComparePassThroughOptionType | Used to pass attributes to CompareItem elements. |
|
|
290
|
+
| handle | ComparePassThroughOptionType | Used to pass attributes to CompareHandle element. |
|
|
291
|
+
| indicator | ComparePassThroughOptionType | Used to pass attributes to CompareIndicator element. |
|
|
292
|
+
| input | ComparePassThroughOptionType | Used to pass attributes to the hidden range input. |
|
|
293
|
+
| hooks | any | Used to manage all lifecycle hooks. |
|
|
294
|
+
|
|
295
|
+
### Theming
|
|
296
|
+
|
|
297
|
+
### CSS Classes
|
|
298
|
+
|
|
299
|
+
| Class |Description |
|
|
300
|
+
| --- | --- |
|
|
301
|
+
| p-compare | Class name of the root element. |
|
|
302
|
+
| p-compare-input | Class name of the hidden range input. |
|
|
303
|
+
|
|
304
|
+
### Design Tokens
|
|
305
|
+
|
|
306
|
+
| Token |CSS Variable |Description |
|
|
307
|
+
| --- | --- | --- |
|
|
308
|
+
| compare.border.radius | --p-compare-border-radius | Border radius of root |
|
|
309
|
+
| compare.handle.background | --p-compare-handle-background | Background of handle (track) |
|
|
310
|
+
| compare.handle.size | --p-compare-handle-size | Size of handle (thickness; width when vertical, height when horizontal) |
|
|
311
|
+
| compare.indicator.size | --p-compare-indicator-size | Size of indicator (square width and height) |
|
|
312
|
+
| compare.indicator.background | --p-compare-indicator-background | Background of indicator |
|
|
313
|
+
| compare.indicator.border.radius | --p-compare-indicator-border-radius | Border radius of indicator |
|
|
314
|
+
| compare.indicator.focus.ring.width | --p-compare-indicator-focus-ring-width | Focus ring width of indicator |
|
|
315
|
+
| compare.indicator.focus.ring.style | --p-compare-indicator-focus-ring-style | Focus ring style of indicator |
|
|
316
|
+
| compare.indicator.focus.ring.color | --p-compare-indicator-focus-ring-color | Focus ring color of indicator |
|
|
317
|
+
| compare.indicator.focus.ring.offset | --p-compare-indicator-focus-ring-offset | Focus ring offset of indicator |
|
|
318
|
+
| compare.indicator.icon.color | --p-compare-indicator-icon-color | Icon color of indicator |
|
|
319
|
+
| compare.indicator.icon.size | --p-compare-indicator-icon-size | Icon size of indicator |
|
|
320
|
+
|
|
321
|
+
## Compare Item API
|
|
322
|
+
|
|
323
|
+
### Props
|
|
324
|
+
|
|
325
|
+
| Name |Type |Default |Description |
|
|
326
|
+
| --- | --- | --- | --- |
|
|
327
|
+
| position | "before" \| "after" | before | Whether the item is before or after the handle. |
|
|
328
|
+
| as | string \| Component | DIV | Use to change the HTML tag of root element. |
|
|
329
|
+
| asChild | boolean | false | When enabled, it changes the default rendered element for the one passed as a child element. |
|
|
330
|
+
| dt | any | - | It generates scoped CSS variables using design tokens for the component. |
|
|
331
|
+
| pt | PassThrough<CompareItemPassThroughOptions> | - | Used to pass attributes to DOM elements inside the component. |
|
|
332
|
+
| ptOptions | any | - | Used to configure passthrough(pt) options of the component. |
|
|
333
|
+
| unstyled | boolean | false | When enabled, it removes component related styles in the core. |
|
|
334
|
+
|
|
335
|
+
### Pass Through Options
|
|
336
|
+
|
|
337
|
+
| Name |Type |Description |
|
|
338
|
+
| --- | --- | --- |
|
|
339
|
+
| root | CompareItemPassThroughOptionType | Used to pass attributes to the root's DOM element. |
|
|
340
|
+
| hooks | any | Used to manage all lifecycle hooks. |
|
|
341
|
+
|
|
342
|
+
### Theming
|
|
343
|
+
|
|
344
|
+
### CSS Classes
|
|
345
|
+
|
|
346
|
+
| Class |Description |
|
|
347
|
+
| --- | --- |
|
|
348
|
+
| p-compare-item | Class name of the root element. |
|
|
349
|
+
|
|
350
|
+
## Compare Handle API
|
|
351
|
+
|
|
352
|
+
### Props
|
|
353
|
+
|
|
354
|
+
| Name |Type |Default |Description |
|
|
355
|
+
| --- | --- | --- | --- |
|
|
356
|
+
| as | string \| Component | SPAN | Use to change the HTML tag of root element. |
|
|
357
|
+
| asChild | boolean | false | When enabled, it changes the default rendered element for the one passed as a child element. |
|
|
358
|
+
| dt | any | - | It generates scoped CSS variables using design tokens for the component. |
|
|
359
|
+
| pt | PassThrough<CompareHandlePassThroughOptions> | - | Used to pass attributes to DOM elements inside the component. |
|
|
360
|
+
| ptOptions | any | - | Used to configure passthrough(pt) options of the component. |
|
|
361
|
+
| unstyled | boolean | false | When enabled, it removes component related styles in the core. |
|
|
362
|
+
|
|
363
|
+
### Pass Through Options
|
|
364
|
+
|
|
365
|
+
| Name |Type |Description |
|
|
366
|
+
| --- | --- | --- |
|
|
367
|
+
| root | CompareHandlePassThroughOptionType | Used to pass attributes to the root's DOM element. |
|
|
368
|
+
| hooks | any | Used to manage all lifecycle hooks. |
|
|
369
|
+
|
|
370
|
+
### Theming
|
|
371
|
+
|
|
372
|
+
### CSS Classes
|
|
373
|
+
|
|
374
|
+
| Class |Description |
|
|
375
|
+
| --- | --- |
|
|
376
|
+
| p-compare-handle | Class name of the root element. |
|
|
377
|
+
|
|
378
|
+
## Compare Indicator API
|
|
379
|
+
|
|
380
|
+
### Props
|
|
381
|
+
|
|
382
|
+
| Name |Type |Default |Description |
|
|
383
|
+
| --- | --- | --- | --- |
|
|
384
|
+
| as | string \| Component | SPAN | Use to change the HTML tag of root element. |
|
|
385
|
+
| asChild | boolean | false | When enabled, it changes the default rendered element for the one passed as a child element. |
|
|
386
|
+
| inputId | string | - | Id of the hidden input. |
|
|
387
|
+
| inputStyle | any | - | Inline style of the hidden input. |
|
|
388
|
+
| inputClass | any | - | Style class of the hidden input. |
|
|
389
|
+
| dt | any | - | It generates scoped CSS variables using design tokens for the component. |
|
|
390
|
+
| pt | PassThrough<CompareIndicatorPassThroughOptions> | - | Used to pass attributes to DOM elements inside the component. |
|
|
391
|
+
| ptOptions | any | - | Used to configure passthrough(pt) options of the component. |
|
|
392
|
+
| unstyled | boolean | false | When enabled, it removes component related styles in the core. |
|
|
393
|
+
|
|
394
|
+
### Pass Through Options
|
|
395
|
+
|
|
396
|
+
| Name |Type |Description |
|
|
397
|
+
| --- | --- | --- |
|
|
398
|
+
| root | CompareIndicatorPassThroughOptionType | Used to pass attributes to the root's DOM element. |
|
|
399
|
+
| hooks | any | Used to manage all lifecycle hooks. |
|
|
400
|
+
|
|
401
|
+
### Theming
|
|
402
|
+
|
|
403
|
+
### CSS Classes
|
|
404
|
+
|
|
405
|
+
| Class |Description |
|
|
406
|
+
| --- | --- |
|
|
407
|
+
| p-compare-indicator | Class name of the root element. |
|