@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,401 @@
|
|
|
1
|
+
# Checkbox
|
|
2
|
+
|
|
3
|
+
Checkbox is an extension to standard checkbox element with theming.
|
|
4
|
+
|
|
5
|
+
## Basic
|
|
6
|
+
|
|
7
|
+
Binary checkbox is used as a controlled input with v-model and binary properties.
|
|
8
|
+
|
|
9
|
+
```vue
|
|
10
|
+
<template>
|
|
11
|
+
<div class="flex justify-center gap-4">
|
|
12
|
+
<Checkbox v-model="checked" binary />
|
|
13
|
+
</div>
|
|
14
|
+
</template>
|
|
15
|
+
|
|
16
|
+
<script setup>
|
|
17
|
+
import { ref } from 'vue';
|
|
18
|
+
|
|
19
|
+
const checked = ref(false);
|
|
20
|
+
<\/script>
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Indicator
|
|
24
|
+
|
|
25
|
+
Use the icon template to customize the visual indicator inside the checkbox.
|
|
26
|
+
|
|
27
|
+
```vue
|
|
28
|
+
<template>
|
|
29
|
+
<div class="flex items-center justify-center">
|
|
30
|
+
<div class="flex items-center gap-2">
|
|
31
|
+
<Checkbox v-model="checked" binary indeterminate inputId="checkbox-indicator" @change="onCheck">
|
|
32
|
+
<template #icon="{ checked, class: iconClass }">
|
|
33
|
+
<Check v-if="checked" :class="iconClass" />
|
|
34
|
+
<Times v-else :class="iconClass" />
|
|
35
|
+
</template>
|
|
36
|
+
</Checkbox>
|
|
37
|
+
<Label for="checkbox-indicator" class="text-sm">Select all notifications</Label>
|
|
38
|
+
</div>
|
|
39
|
+
</div>
|
|
40
|
+
</template>
|
|
41
|
+
|
|
42
|
+
<script setup>
|
|
43
|
+
import { ref } from 'vue';
|
|
44
|
+
import Check from '@primeicons/vue/check';
|
|
45
|
+
import Minus from '@primeicons/vue/minus';
|
|
46
|
+
import Times from '@primeicons/vue/times';
|
|
47
|
+
|
|
48
|
+
const checked = ref(false);
|
|
49
|
+
const isIndeterminate = ref(true);
|
|
50
|
+
|
|
51
|
+
const onCheck = () => {
|
|
52
|
+
isIndeterminate.value = false;
|
|
53
|
+
};
|
|
54
|
+
<\/script>
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
## Indeterminate
|
|
58
|
+
|
|
59
|
+
The indeterminate state indicates that a checkbox is neither "on" or "off".
|
|
60
|
+
|
|
61
|
+
```vue
|
|
62
|
+
<template>
|
|
63
|
+
<div class="flex items-center gap-2 justify-center">
|
|
64
|
+
<Checkbox v-model="checked" binary indeterminate inputId="indeterminate-checkbox" />
|
|
65
|
+
<Label for="indeterminate-checkbox" class="text-sm">Email Notifications</Label>
|
|
66
|
+
</div>
|
|
67
|
+
</template>
|
|
68
|
+
|
|
69
|
+
<script setup>
|
|
70
|
+
import { ref } from 'vue';
|
|
71
|
+
|
|
72
|
+
const checked = ref(false);
|
|
73
|
+
<\/script>
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
## Dynamic
|
|
77
|
+
|
|
78
|
+
Checkboxes can be generated using a list of values.
|
|
79
|
+
|
|
80
|
+
```vue
|
|
81
|
+
<template>
|
|
82
|
+
<div class="flex justify-center">
|
|
83
|
+
<div class="flex flex-col gap-4">
|
|
84
|
+
<div v-for="category of categories" :key="category.key" class="flex items-center gap-2">
|
|
85
|
+
<Checkbox v-model="selectedCategories" :inputId="category.key" name="group" :value="category" />
|
|
86
|
+
<Label :for="category.key" class="text-sm">{{ category.name }}</Label>
|
|
87
|
+
</div>
|
|
88
|
+
</div>
|
|
89
|
+
</div>
|
|
90
|
+
</template>
|
|
91
|
+
|
|
92
|
+
<script setup>
|
|
93
|
+
import { ref } from 'vue';
|
|
94
|
+
|
|
95
|
+
const categories = ref([
|
|
96
|
+
{ name: 'Accounting', key: 'A' },
|
|
97
|
+
{ name: 'Marketing', key: 'M' },
|
|
98
|
+
{ name: 'Production', key: 'P' },
|
|
99
|
+
{ name: 'Research', key: 'R' }
|
|
100
|
+
]);
|
|
101
|
+
const selectedCategories = ref([categories.value[1]]);
|
|
102
|
+
<\/script>
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
## Sizes
|
|
106
|
+
|
|
107
|
+
Checkbox provides small and large sizes as alternatives to the base.
|
|
108
|
+
|
|
109
|
+
```vue
|
|
110
|
+
<template>
|
|
111
|
+
<div class="flex flex-wrap items-center justify-center gap-4">
|
|
112
|
+
<div class="flex items-center gap-2">
|
|
113
|
+
<Checkbox v-model="small" binary inputId="small-checkbox" size="small" />
|
|
114
|
+
<Label for="small-checkbox" class="text-sm">Small</Label>
|
|
115
|
+
</div>
|
|
116
|
+
<div class="flex items-center gap-2">
|
|
117
|
+
<Checkbox v-model="normal" binary inputId="normal-checkbox" />
|
|
118
|
+
<Label for="normal-checkbox" class="text-sm">Normal</Label>
|
|
119
|
+
</div>
|
|
120
|
+
<div class="flex items-center gap-2">
|
|
121
|
+
<Checkbox v-model="large" binary inputId="large-checkbox" size="large" />
|
|
122
|
+
<Label for="large-checkbox" class="text-sm">Large</Label>
|
|
123
|
+
</div>
|
|
124
|
+
</div>
|
|
125
|
+
</template>
|
|
126
|
+
|
|
127
|
+
<script setup>
|
|
128
|
+
import { ref } from 'vue';
|
|
129
|
+
|
|
130
|
+
const small = ref(false);
|
|
131
|
+
const normal = ref(false);
|
|
132
|
+
const large = ref(false);
|
|
133
|
+
<\/script>
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
## Filled
|
|
137
|
+
|
|
138
|
+
Specify the variant property as filled to display the component with a higher visual emphasis than the default outlined style.
|
|
139
|
+
|
|
140
|
+
```vue
|
|
141
|
+
<template>
|
|
142
|
+
<div class="flex items-center justify-center">
|
|
143
|
+
<div class="flex items-center gap-2">
|
|
144
|
+
<Checkbox v-model="checked" binary variant="filled" inputId="filled-checkbox" />
|
|
145
|
+
<Label for="filled-checkbox" class="text-sm">Filled</Label>
|
|
146
|
+
</div>
|
|
147
|
+
</div>
|
|
148
|
+
</template>
|
|
149
|
+
|
|
150
|
+
<script setup>
|
|
151
|
+
import { ref } from 'vue';
|
|
152
|
+
|
|
153
|
+
const checked = ref(false);
|
|
154
|
+
<\/script>
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
## Disabled
|
|
158
|
+
|
|
159
|
+
When disabled is present, the element cannot be edited and focused.
|
|
160
|
+
|
|
161
|
+
```vue
|
|
162
|
+
<template>
|
|
163
|
+
<div class="flex items-center justify-center gap-4">
|
|
164
|
+
<Checkbox v-model="checked1" binary disabled />
|
|
165
|
+
<Checkbox v-model="checked2" binary disabled />
|
|
166
|
+
</div>
|
|
167
|
+
</template>
|
|
168
|
+
|
|
169
|
+
<script setup>
|
|
170
|
+
import { ref } from 'vue';
|
|
171
|
+
|
|
172
|
+
const checked1 = ref(false);
|
|
173
|
+
const checked2 = ref(true);
|
|
174
|
+
<\/script>
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
## Invalid
|
|
178
|
+
|
|
179
|
+
The invalid state is applied using the invalid property to indicate failed validation, which can be integrated with form validation libraries.
|
|
180
|
+
|
|
181
|
+
```vue
|
|
182
|
+
<template>
|
|
183
|
+
<div class="flex items-center justify-center">
|
|
184
|
+
<div class="flex items-center gap-2">
|
|
185
|
+
<Checkbox v-model="checked" binary :invalid="!checked" inputId="invalid-checkbox" />
|
|
186
|
+
<Label for="invalid-checkbox" :class="['transition-colors', { 'text-red-500! dark:text-red-400!': !checked }]">Invalid</Label>
|
|
187
|
+
</div>
|
|
188
|
+
</div>
|
|
189
|
+
</template>
|
|
190
|
+
|
|
191
|
+
<script setup>
|
|
192
|
+
import { ref } from 'vue';
|
|
193
|
+
|
|
194
|
+
const checked = ref(false);
|
|
195
|
+
<\/script>
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
## Forms
|
|
199
|
+
|
|
200
|
+
Checkbox integrates seamlessly with the PrimeVue Forms library.
|
|
201
|
+
|
|
202
|
+
```vue
|
|
203
|
+
<template>
|
|
204
|
+
<div class="flex justify-center">
|
|
205
|
+
<Form v-slot="$form" :resolver="resolver" :initialValues="initialValues" @submit="onFormSubmit" class="flex justify-center flex-col gap-4">
|
|
206
|
+
<div class="flex flex-col gap-2">
|
|
207
|
+
<CheckboxGroup name="ingredient" class="flex flex-wrap gap-4">
|
|
208
|
+
<div class="flex items-center gap-2">
|
|
209
|
+
<Checkbox inputId="cheese" value="Cheese" />
|
|
210
|
+
<Label for="cheese"> Cheese </Label>
|
|
211
|
+
</div>
|
|
212
|
+
<div class="flex items-center gap-2">
|
|
213
|
+
<Checkbox inputId="mushroom" value="Mushroom" />
|
|
214
|
+
<Label for="mushroom"> Mushroom </Label>
|
|
215
|
+
</div>
|
|
216
|
+
<div class="flex items-center gap-2">
|
|
217
|
+
<Checkbox inputId="pepper" value="Pepper" />
|
|
218
|
+
<Label for="pepper"> Pepper </Label>
|
|
219
|
+
</div>
|
|
220
|
+
<div class="flex items-center gap-2">
|
|
221
|
+
<Checkbox inputId="onion" value="Onion" />
|
|
222
|
+
<Label for="onion"> Onion </Label>
|
|
223
|
+
</div>
|
|
224
|
+
</CheckboxGroup>
|
|
225
|
+
<Message v-if="$form.ingredient?.invalid" severity="error" size="small" variant="simple">{{ $form.ingredient.error?.message }}</Message>
|
|
226
|
+
</div>
|
|
227
|
+
<Button type="submit" severity="secondary">Submit</Button>
|
|
228
|
+
</Form>
|
|
229
|
+
</div>
|
|
230
|
+
<Toast />
|
|
231
|
+
</template>
|
|
232
|
+
|
|
233
|
+
<script setup>
|
|
234
|
+
import { ref } from 'vue';
|
|
235
|
+
import { zodResolver } from '@primevue/forms/resolvers/zod';
|
|
236
|
+
import { useToast } from "primevue/usetoast";
|
|
237
|
+
import { z } from 'zod';
|
|
238
|
+
|
|
239
|
+
const toast = useToast();
|
|
240
|
+
const initialValues = ref({
|
|
241
|
+
ingredient: []
|
|
242
|
+
});
|
|
243
|
+
const resolver = ref(zodResolver(
|
|
244
|
+
z.object({
|
|
245
|
+
ingredient: z.array(z.string()).min(1, { message: 'At least one ingredient must be selected.' })
|
|
246
|
+
})
|
|
247
|
+
));
|
|
248
|
+
|
|
249
|
+
const onFormSubmit = ({ valid }) => {
|
|
250
|
+
if (valid) {
|
|
251
|
+
toast.add({ severity: 'success', summary: 'Form is submitted.', life: 3000 });
|
|
252
|
+
}
|
|
253
|
+
};
|
|
254
|
+
<\/script>
|
|
255
|
+
```
|
|
256
|
+
|
|
257
|
+
## Accessibility
|
|
258
|
+
|
|
259
|
+
Screen Reader Checkbox component uses a hidden native checkbox element internally that is only visible to screen readers. Value to describe the component can either be provided via label tag combined with inputId prop or using aria-labelledby , aria-label props. Keyboard Support Key Function tab Moves focus to the checkbox. space Toggles the checked state.
|
|
260
|
+
|
|
261
|
+
```vue
|
|
262
|
+
<template>
|
|
263
|
+
<label for="chkbox1">Remember Me</label>
|
|
264
|
+
<Checkbox inputId="chkbox1" />
|
|
265
|
+
|
|
266
|
+
<span id="chkbox2">Remember Me</span>
|
|
267
|
+
<Checkbox aria-labelledby="chkbox2" />
|
|
268
|
+
|
|
269
|
+
<Checkbox aria-label="Remember Me" />
|
|
270
|
+
</template>
|
|
271
|
+
```
|
|
272
|
+
|
|
273
|
+
## Checkbox API
|
|
274
|
+
|
|
275
|
+
### Props
|
|
276
|
+
|
|
277
|
+
| Name |Type |Default |Description |
|
|
278
|
+
| --- | --- | --- | --- |
|
|
279
|
+
| value | any | - | Value of the checkbox. |
|
|
280
|
+
| modelValue | any | - | Value binding of the checkbox. |
|
|
281
|
+
| defaultValue | any | - | The default value for the input when not controlled by `modelValue` . |
|
|
282
|
+
| name | string | - | Name of the input element. |
|
|
283
|
+
| binary | boolean | - | Allows to select a boolean value instead of multiple values. |
|
|
284
|
+
| indeterminate | boolean | - | When present, it specifies input state as indeterminate. |
|
|
285
|
+
| size | "small" \| "large" | - | Defines the size of the component. |
|
|
286
|
+
| invalid | boolean | false | When present, it specifies that the component should have invalid state style. |
|
|
287
|
+
| disabled | boolean | - | When present, it specifies that the element should be disabled. |
|
|
288
|
+
| variant | null \| HintedString<"outlined" \| "filled"> | null | Specifies the input variant of the component. |
|
|
289
|
+
| readonly | boolean | - | When present, it specifies that an input field is read-only. |
|
|
290
|
+
| required | boolean | - | When present, it specifies that the element is required. |
|
|
291
|
+
| tabindex | number | - | Index of the element in tabbing order. |
|
|
292
|
+
| trueValue | any | - | Value in checked state. |
|
|
293
|
+
| falseValue | any | - | Value in unchecked state. |
|
|
294
|
+
| inputId | string | - | Identifier of the underlying input element. |
|
|
295
|
+
| inputClass | object | - | Style class of the input field. |
|
|
296
|
+
| inputStyle | string \| object | - | Inline style of the input field. |
|
|
297
|
+
| ariaLabelledby | string | - | Establishes relationships between the component and label(s) where its value should be one or more element IDs. |
|
|
298
|
+
| ariaLabel | string | - | Establishes a string value that labels the component. |
|
|
299
|
+
| formControl | Record<string, any> | - | Form control object, typically used for handling validation and form state. |
|
|
300
|
+
| dt | any | - | It generates scoped CSS variables using design tokens for the component. |
|
|
301
|
+
| pt | PassThrough<CheckboxPassThroughOptions> | - | Used to pass attributes to DOM elements inside the component. |
|
|
302
|
+
| ptOptions | any | - | Used to configure passthrough(pt) options of the component. |
|
|
303
|
+
| unstyled | boolean | false | When enabled, it removes component related styles in the core. |
|
|
304
|
+
|
|
305
|
+
### Pass Through Options
|
|
306
|
+
|
|
307
|
+
| Name |Type |Description |
|
|
308
|
+
| --- | --- | --- |
|
|
309
|
+
| root | CheckboxPassThroughOptionType | Used to pass attributes to the root's DOM element. |
|
|
310
|
+
| input | CheckboxPassThroughOptionType | Used to pass attributes to the input's DOM element. |
|
|
311
|
+
| box | CheckboxPassThroughOptionType | Used to pass attributes to the box's DOM element. |
|
|
312
|
+
| indicator | CheckboxPassThroughOptionType | Used to pass attributes to the indicator's DOM element. |
|
|
313
|
+
| icon | CheckboxPassThroughOptionType | Used to pass attributes to the icon's DOM element. |
|
|
314
|
+
| hooks | any | Used to manage all lifecycle hooks. |
|
|
315
|
+
|
|
316
|
+
### Theming
|
|
317
|
+
|
|
318
|
+
### CSS Classes
|
|
319
|
+
|
|
320
|
+
| Class |Description |
|
|
321
|
+
| --- | --- |
|
|
322
|
+
| p-checkbox | Class name of the root element |
|
|
323
|
+
| p-checkbox-box | Class name of the box element |
|
|
324
|
+
| p-checkbox-input | Class name of the input element |
|
|
325
|
+
| p-checkbox-icon | Class name of the icon element |
|
|
326
|
+
|
|
327
|
+
### Design Tokens
|
|
328
|
+
|
|
329
|
+
| Token |CSS Variable |Description |
|
|
330
|
+
| --- | --- | --- |
|
|
331
|
+
| checkbox.border.radius | --p-checkbox-border-radius | Border radius of root |
|
|
332
|
+
| checkbox.width | --p-checkbox-width | Width of root |
|
|
333
|
+
| checkbox.height | --p-checkbox-height | Height of root |
|
|
334
|
+
| checkbox.background | --p-checkbox-background | Background of root |
|
|
335
|
+
| checkbox.checked.background | --p-checkbox-checked-background | Checked background of root |
|
|
336
|
+
| checkbox.checked.hover.background | --p-checkbox-checked-hover-background | Checked hover background of root |
|
|
337
|
+
| checkbox.disabled.background | --p-checkbox-disabled-background | Disabled background of root |
|
|
338
|
+
| checkbox.filled.background | --p-checkbox-filled-background | Filled background of root |
|
|
339
|
+
| checkbox.border.color | --p-checkbox-border-color | Border color of root |
|
|
340
|
+
| checkbox.hover.border.color | --p-checkbox-hover-border-color | Hover border color of root |
|
|
341
|
+
| checkbox.focus.border.color | --p-checkbox-focus-border-color | Focus border color of root |
|
|
342
|
+
| checkbox.checked.border.color | --p-checkbox-checked-border-color | Checked border color of root |
|
|
343
|
+
| checkbox.checked.hover.border.color | --p-checkbox-checked-hover-border-color | Checked hover border color of root |
|
|
344
|
+
| checkbox.checked.focus.border.color | --p-checkbox-checked-focus-border-color | Checked focus border color of root |
|
|
345
|
+
| checkbox.checked.disabled.border.color | --p-checkbox-checked-disabled-border-color | Checked disabled border color of root |
|
|
346
|
+
| checkbox.invalid.border.color | --p-checkbox-invalid-border-color | Invalid border color of root |
|
|
347
|
+
| checkbox.shadow | --p-checkbox-shadow | Shadow of root |
|
|
348
|
+
| checkbox.focus.ring.width | --p-checkbox-focus-ring-width | Focus ring width of root |
|
|
349
|
+
| checkbox.focus.ring.style | --p-checkbox-focus-ring-style | Focus ring style of root |
|
|
350
|
+
| checkbox.focus.ring.color | --p-checkbox-focus-ring-color | Focus ring color of root |
|
|
351
|
+
| checkbox.focus.ring.offset | --p-checkbox-focus-ring-offset | Focus ring offset of root |
|
|
352
|
+
| checkbox.focus.ring.shadow | --p-checkbox-focus-ring-shadow | Focus ring shadow of root |
|
|
353
|
+
| checkbox.transition.duration | --p-checkbox-transition-duration | Transition duration of root |
|
|
354
|
+
| checkbox.sm.width | --p-checkbox-sm-width | Sm width of root |
|
|
355
|
+
| checkbox.sm.height | --p-checkbox-sm-height | Sm height of root |
|
|
356
|
+
| checkbox.lg.width | --p-checkbox-lg-width | Lg width of root |
|
|
357
|
+
| checkbox.lg.height | --p-checkbox-lg-height | Lg height of root |
|
|
358
|
+
| checkbox.icon.size | --p-checkbox-icon-size | Size of icon |
|
|
359
|
+
| checkbox.icon.color | --p-checkbox-icon-color | Color of icon |
|
|
360
|
+
| checkbox.icon.checked.color | --p-checkbox-icon-checked-color | Checked color of icon |
|
|
361
|
+
| checkbox.icon.checked.hover.color | --p-checkbox-icon-checked-hover-color | Checked hover color of icon |
|
|
362
|
+
| checkbox.icon.disabled.color | --p-checkbox-icon-disabled-color | Disabled color of icon |
|
|
363
|
+
| checkbox.icon.sm.size | --p-checkbox-icon-sm-size | Sm size of icon |
|
|
364
|
+
| checkbox.icon.lg.size | --p-checkbox-icon-lg-size | Lg size of icon |
|
|
365
|
+
|
|
366
|
+
## Checkbox Group API
|
|
367
|
+
|
|
368
|
+
### Props
|
|
369
|
+
|
|
370
|
+
| Name |Type |Default |Description |
|
|
371
|
+
| --- | --- | --- | --- |
|
|
372
|
+
| modelValue | any | - | Value binding of the checkboxes. |
|
|
373
|
+
| defaultValue | any | - | Default values of the checkboxes in uncontrolled mode. |
|
|
374
|
+
| name | string | - | Name of the input elements. |
|
|
375
|
+
| invalid | boolean | false | When present, it specifies that the component should have invalid state style. |
|
|
376
|
+
| formControl | any | - | Used to set form control options. |
|
|
377
|
+
| dt | any | - | It generates scoped CSS variables using design tokens for the component. |
|
|
378
|
+
| pt | PassThrough<CheckboxGroupPassThroughOptions> | - | Used to pass attributes to DOM elements inside the component. |
|
|
379
|
+
| ptOptions | any | - | Used to configure passthrough(pt) options of the component. |
|
|
380
|
+
| unstyled | boolean | false | When enabled, it removes component related styles in the core. |
|
|
381
|
+
|
|
382
|
+
### Slots
|
|
383
|
+
|
|
384
|
+
| Name |Parameters |Description |
|
|
385
|
+
| --- | --- | --- |
|
|
386
|
+
| default | Function | |
|
|
387
|
+
|
|
388
|
+
### Pass Through Options
|
|
389
|
+
|
|
390
|
+
| Name |Type |Description |
|
|
391
|
+
| --- | --- | --- |
|
|
392
|
+
| root | CheckboxGroupPassThroughOptionType | Used to pass attributes to the root's DOM element. |
|
|
393
|
+
| hooks | any | Used to manage all lifecycle hooks. |
|
|
394
|
+
|
|
395
|
+
### Theming
|
|
396
|
+
|
|
397
|
+
### CSS Classes
|
|
398
|
+
|
|
399
|
+
| Class |Description |
|
|
400
|
+
| --- | --- |
|
|
401
|
+
| p-checkbox-group | Class name of the root element |
|
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
# Chip
|
|
2
|
+
|
|
3
|
+
Chip represents entities using icons, labels and images.
|
|
4
|
+
|
|
5
|
+
## Basic
|
|
6
|
+
|
|
7
|
+
Displays compact information with an optional remove action.
|
|
8
|
+
|
|
9
|
+
```vue
|
|
10
|
+
<template>
|
|
11
|
+
<div class="flex items-center justify-center">
|
|
12
|
+
<Chip label="GitHub">
|
|
13
|
+
<template #icon>
|
|
14
|
+
<Github />
|
|
15
|
+
</template>
|
|
16
|
+
</Chip>
|
|
17
|
+
</div>
|
|
18
|
+
</template>
|
|
19
|
+
|
|
20
|
+
<script setup>
|
|
21
|
+
import Chip from 'primevue/chip';
|
|
22
|
+
import Github from '@primeicons/vue/github';
|
|
23
|
+
<\/script>
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## Icon
|
|
27
|
+
|
|
28
|
+
A font icon next to the label can be displayed with the icon property. Use removable to add a remove action.
|
|
29
|
+
|
|
30
|
+
```vue
|
|
31
|
+
<template>
|
|
32
|
+
<div class="flex items-center justify-center flex-wrap gap-2">
|
|
33
|
+
<Chip label="Apple">
|
|
34
|
+
<template #icon>
|
|
35
|
+
<Apple />
|
|
36
|
+
</template>
|
|
37
|
+
</Chip>
|
|
38
|
+
<Chip label="Facebook">
|
|
39
|
+
<template #icon>
|
|
40
|
+
<Facebook />
|
|
41
|
+
</template>
|
|
42
|
+
</Chip>
|
|
43
|
+
<Chip label="Google">
|
|
44
|
+
<template #icon>
|
|
45
|
+
<Google />
|
|
46
|
+
</template>
|
|
47
|
+
</Chip>
|
|
48
|
+
<Chip label="Microsoft">
|
|
49
|
+
<template #icon>
|
|
50
|
+
<Microsoft />
|
|
51
|
+
</template>
|
|
52
|
+
</Chip>
|
|
53
|
+
<Chip label="GitHub" removable>
|
|
54
|
+
<template #icon>
|
|
55
|
+
<Github />
|
|
56
|
+
</template>
|
|
57
|
+
</Chip>
|
|
58
|
+
</div>
|
|
59
|
+
</template>
|
|
60
|
+
|
|
61
|
+
<script setup>
|
|
62
|
+
import Chip from 'primevue/chip';
|
|
63
|
+
import Apple from '@primeicons/vue/apple';
|
|
64
|
+
import Facebook from '@primeicons/vue/facebook';
|
|
65
|
+
import Github from '@primeicons/vue/github';
|
|
66
|
+
import Google from '@primeicons/vue/google';
|
|
67
|
+
import Microsoft from '@primeicons/vue/microsoft';
|
|
68
|
+
<\/script>
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
## Image
|
|
72
|
+
|
|
73
|
+
The image property is used to display an image like an avatar.
|
|
74
|
+
|
|
75
|
+
```vue
|
|
76
|
+
<template>
|
|
77
|
+
<div class="flex items-center justify-center flex-wrap gap-2">
|
|
78
|
+
<Chip label="Amy Elsner" image="https://primefaces.org/cdn/primevue/images/avatar/amyelsner.png" />
|
|
79
|
+
<Chip label="Asiya Javayant" image="https://primefaces.org/cdn/primevue/images/avatar/asiyajavayant.png" />
|
|
80
|
+
<Chip label="Onyama Limba" image="https://primefaces.org/cdn/primevue/images/avatar/onyamalimba.png" />
|
|
81
|
+
<Chip label="Xuxue Feng" image="https://primefaces.org/cdn/primevue/images/avatar/xuxuefeng.png" removable />
|
|
82
|
+
</div>
|
|
83
|
+
</template>
|
|
84
|
+
|
|
85
|
+
<script setup>
|
|
86
|
+
import Chip from 'primevue/chip';
|
|
87
|
+
<\/script>
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
## Template
|
|
91
|
+
|
|
92
|
+
Chip also allows displaying custom content inside itself.
|
|
93
|
+
|
|
94
|
+
```vue
|
|
95
|
+
<template>
|
|
96
|
+
<div class="flex items-center justify-center flex-wrap gap-2">
|
|
97
|
+
<Chip label="Apple" class="bg-neutral-900! dark:bg-neutral-50! text-neutral-50! dark:text-neutral-900!">
|
|
98
|
+
<template #icon>
|
|
99
|
+
<Apple />
|
|
100
|
+
</template>
|
|
101
|
+
</Chip>
|
|
102
|
+
<Chip label="Facebook" class="bg-blue-50! dark:bg-blue-950! text-blue-700! dark:text-blue-300!">
|
|
103
|
+
<template #icon>
|
|
104
|
+
<Facebook />
|
|
105
|
+
</template>
|
|
106
|
+
</Chip>
|
|
107
|
+
<Chip label="Google" class="bg-red-50! dark:bg-red-950! text-red-700! dark:text-red-300!">
|
|
108
|
+
<template #icon>
|
|
109
|
+
<Google />
|
|
110
|
+
</template>
|
|
111
|
+
</Chip>
|
|
112
|
+
<Chip label="Microsoft" class="bg-green-50! dark:bg-green-950! text-green-700! dark:text-green-300!">
|
|
113
|
+
<template #icon>
|
|
114
|
+
<Microsoft />
|
|
115
|
+
</template>
|
|
116
|
+
</Chip>
|
|
117
|
+
<Chip label="GitHub" removable class="bg-purple-50! dark:bg-purple-950! text-purple-700! dark:text-purple-300!">
|
|
118
|
+
<template #icon>
|
|
119
|
+
<Github />
|
|
120
|
+
</template>
|
|
121
|
+
</Chip>
|
|
122
|
+
</div>
|
|
123
|
+
</template>
|
|
124
|
+
|
|
125
|
+
<script setup>
|
|
126
|
+
import Chip from 'primevue/chip';
|
|
127
|
+
import Apple from '@primeicons/vue/apple';
|
|
128
|
+
import Facebook from '@primeicons/vue/facebook';
|
|
129
|
+
import Github from '@primeicons/vue/github';
|
|
130
|
+
import Google from '@primeicons/vue/google';
|
|
131
|
+
import Microsoft from '@primeicons/vue/microsoft';
|
|
132
|
+
<\/script>
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
## Style
|
|
136
|
+
|
|
137
|
+
List of class names used in the styled mode.
|
|
138
|
+
|
|
139
|
+
## Accessibility
|
|
140
|
+
|
|
141
|
+
Screen Reader Chip uses the label property as the default aria-label , since any attribute is passed to the root element aria-labelledby or aria-label can be used to override the default behavior. Removable chips have a tabindex and focusable with the tab key. Keyboard Support Key Function backspace Hides removable. enter Hides removable.
|
|
142
|
+
|
|
143
|
+
## Chip API
|
|
144
|
+
|
|
145
|
+
### Props
|
|
146
|
+
|
|
147
|
+
| Name |Type |Default |Description |
|
|
148
|
+
| --- | --- | --- | --- |
|
|
149
|
+
| label | string \| number | - | Defines the text to display. |
|
|
150
|
+
| icon | string | - | Defines the icon to display. |
|
|
151
|
+
| image | string | - | Defines the image to display. |
|
|
152
|
+
| removable | boolean | false | Whether to display a remove icon. |
|
|
153
|
+
| removeIcon | string | - | Icon of the remove element. |
|
|
154
|
+
| dt | any | - | It generates scoped CSS variables using design tokens for the component. |
|
|
155
|
+
| pt | PassThrough<ChipPassThroughOptions<any>> | - | Used to pass attributes to DOM elements inside the component. |
|
|
156
|
+
| ptOptions | any | - | Used to configure passthrough(pt) options of the component. |
|
|
157
|
+
| unstyled | boolean | false | When enabled, it removes component related styles in the core. |
|
|
158
|
+
|
|
159
|
+
### Pass Through Options
|
|
160
|
+
|
|
161
|
+
| Name |Type |Description |
|
|
162
|
+
| --- | --- | --- |
|
|
163
|
+
| root | ChipPassThroughOptionType<T> | Used to pass attributes to the root's DOM element. |
|
|
164
|
+
| image | ChipPassThroughOptionType<T> | Used to pass attributes to the image's DOM element. |
|
|
165
|
+
| icon | ChipPassThroughOptionType<T> | Used to pass attributes to the icon's DOM element. |
|
|
166
|
+
| label | ChipPassThroughOptionType<T> | Used to pass attributes to the label' DOM element. |
|
|
167
|
+
| removeIcon | ChipPassThroughOptionType<T> | Used to pass attributes to the removeIcon's DOM element. |
|
|
168
|
+
| hooks | any | Used to manage all lifecycle hooks. |
|
|
169
|
+
|
|
170
|
+
### Theming
|
|
171
|
+
|
|
172
|
+
### CSS Classes
|
|
173
|
+
|
|
174
|
+
| Class |Description |
|
|
175
|
+
| --- | --- |
|
|
176
|
+
| p-chip | Class name of the root element |
|
|
177
|
+
| p-chip-image | Class name of the image element |
|
|
178
|
+
| p-chip-icon | Class name of the icon element |
|
|
179
|
+
| p-chip-label | Class name of the label element |
|
|
180
|
+
| p-chip-remove-icon | Class name of the remove icon element |
|
|
181
|
+
|
|
182
|
+
### Design Tokens
|
|
183
|
+
|
|
184
|
+
| Token |CSS Variable |Description |
|
|
185
|
+
| --- | --- | --- |
|
|
186
|
+
| chip.border.radius | --p-chip-border-radius | Border radius of root |
|
|
187
|
+
| chip.padding.x | --p-chip-padding-x | Padding x of root |
|
|
188
|
+
| chip.padding.y | --p-chip-padding-y | Padding y of root |
|
|
189
|
+
| chip.gap | --p-chip-gap | Gap of root |
|
|
190
|
+
| chip.transition.duration | --p-chip-transition-duration | Transition duration of root |
|
|
191
|
+
| chip.background | --p-chip-background | Background of root |
|
|
192
|
+
| chip.focus.background | --p-chip-focus-background | Focus background of root |
|
|
193
|
+
| chip.color | --p-chip-color | Color of root |
|
|
194
|
+
| chip.image.width | --p-chip-image-width | Width of image |
|
|
195
|
+
| chip.image.height | --p-chip-image-height | Height of image |
|
|
196
|
+
| chip.icon.size | --p-chip-icon-size | Size of icon |
|
|
197
|
+
| chip.icon.color | --p-chip-icon-color | Color of icon |
|
|
198
|
+
| chip.label.font.weight | --p-chip-label-font-weight | Font weight of label |
|
|
199
|
+
| chip.label.font.size | --p-chip-label-font-size | Font size of label |
|
|
200
|
+
| chip.remove.icon.size | --p-chip-remove-icon-size | Size of remove icon |
|
|
201
|
+
| chip.remove.icon.focus.ring.width | --p-chip-remove-icon-focus-ring-width | Focus ring width of remove icon |
|
|
202
|
+
| chip.remove.icon.focus.ring.style | --p-chip-remove-icon-focus-ring-style | Focus ring style of remove icon |
|
|
203
|
+
| chip.remove.icon.focus.ring.color | --p-chip-remove-icon-focus-ring-color | Focus ring color of remove icon |
|
|
204
|
+
| chip.remove.icon.focus.ring.offset | --p-chip-remove-icon-focus-ring-offset | Focus ring offset of remove icon |
|
|
205
|
+
| chip.remove.icon.focus.ring.shadow | --p-chip-remove-icon-focus-ring-shadow | Focus ring shadow of remove icon |
|
|
206
|
+
| chip.remove.icon.color | --p-chip-remove-icon-color | Color of remove icon |
|