@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,609 @@
|
|
|
1
|
+
# Tabs
|
|
2
|
+
|
|
3
|
+
Tabs is a container component to group content with tabs.
|
|
4
|
+
|
|
5
|
+
## Basic
|
|
6
|
+
|
|
7
|
+
Organizes content into selectable, horizontally laid out sections.
|
|
8
|
+
|
|
9
|
+
```vue
|
|
10
|
+
<template>
|
|
11
|
+
<Tabs value="tab1">
|
|
12
|
+
<TabList>
|
|
13
|
+
<Tab value="tab1">Account Info</Tab>
|
|
14
|
+
<Tab value="tab2">Payment</Tab>
|
|
15
|
+
<Tab value="tab3">Preferences</Tab>
|
|
16
|
+
</TabList>
|
|
17
|
+
<TabPanels>
|
|
18
|
+
<TabPanel value="tab1">
|
|
19
|
+
<h2 class="text-lg font-bold">Account Info</h2>
|
|
20
|
+
<p class="text-surface-500 mt-1">Update your personal information such as name, email address, and profile picture.</p>
|
|
21
|
+
</TabPanel>
|
|
22
|
+
<TabPanel value="tab2">
|
|
23
|
+
<h2 class="text-lg font-bold">Payment</h2>
|
|
24
|
+
<p class="text-surface-500 mt-1">Manage your subscription plan, view invoices, and update your payment method.</p>
|
|
25
|
+
</TabPanel>
|
|
26
|
+
<TabPanel value="tab3">
|
|
27
|
+
<h2 class="text-lg font-bold">Preferences</h2>
|
|
28
|
+
<p class="text-surface-500 mt-1">Customize how the application looks and behaves to match your personal preferences.</p>
|
|
29
|
+
</TabPanel>
|
|
30
|
+
</TabPanels>
|
|
31
|
+
</Tabs>
|
|
32
|
+
</template>
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## Dynamic
|
|
36
|
+
|
|
37
|
+
Create tabs from an array to keep labels and panel content in sync.
|
|
38
|
+
|
|
39
|
+
```vue
|
|
40
|
+
<template>
|
|
41
|
+
<Tabs value="tab1">
|
|
42
|
+
<TabList>
|
|
43
|
+
<Tab v-for="tab in tabs" :key="tab.id" :value="tab.id">{{ tab.title }}</Tab>
|
|
44
|
+
</TabList>
|
|
45
|
+
<TabPanels>
|
|
46
|
+
<TabPanel v-for="tab in tabs" :key="tab.id" :value="tab.id">
|
|
47
|
+
<h2 class="text-lg font-bold">{{ tab.title }}</h2>
|
|
48
|
+
<p class="text-surface-500 mt-1">{{ tab.content }}</p>
|
|
49
|
+
</TabPanel>
|
|
50
|
+
</TabPanels>
|
|
51
|
+
</Tabs>
|
|
52
|
+
</template>
|
|
53
|
+
|
|
54
|
+
<script setup>
|
|
55
|
+
import { ref } from 'vue';
|
|
56
|
+
|
|
57
|
+
const tabs = ref([
|
|
58
|
+
{ id: 'tab1', title: 'Account Info', content: 'Update your personal information such as name, email address, and profile picture.' },
|
|
59
|
+
{ id: 'tab2', title: 'Payment', content: 'Manage your subscription plan, view invoices, and update your payment method.' },
|
|
60
|
+
{ id: 'tab3', title: 'Preferences', content: 'Customize how the application looks and behaves to match your personal preferences.' }
|
|
61
|
+
]);
|
|
62
|
+
<\/script>
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
## Controlled
|
|
66
|
+
|
|
67
|
+
Control the active tab with the value property.
|
|
68
|
+
|
|
69
|
+
```vue
|
|
70
|
+
<template>
|
|
71
|
+
<div class="space-y-4">
|
|
72
|
+
<Button type="button" @click="value = 'tab2'">Go to Payment</Button>
|
|
73
|
+
<Tabs v-model:value="value">
|
|
74
|
+
<TabList>
|
|
75
|
+
<Tab v-for="tab in tabs" :key="tab.id" :value="tab.id">{{ tab.title }}</Tab>
|
|
76
|
+
</TabList>
|
|
77
|
+
<TabPanels>
|
|
78
|
+
<TabPanel v-for="tab in tabs" :key="tab.id" :value="tab.id">
|
|
79
|
+
<h2 class="text-lg font-bold">{{ tab.title }}</h2>
|
|
80
|
+
<p class="text-surface-500 mt-1">{{ tab.content }}</p>
|
|
81
|
+
</TabPanel>
|
|
82
|
+
</TabPanels>
|
|
83
|
+
</Tabs>
|
|
84
|
+
</div>
|
|
85
|
+
</template>
|
|
86
|
+
|
|
87
|
+
<script setup>
|
|
88
|
+
import { ref } from 'vue';
|
|
89
|
+
|
|
90
|
+
const value = ref('tab1');
|
|
91
|
+
const tabs = ref([
|
|
92
|
+
{ id: 'tab1', title: 'Account Info', content: 'Update your personal information such as name, email address, and profile picture.' },
|
|
93
|
+
{ id: 'tab2', title: 'Payment', content: 'Manage your subscription plan, view invoices, and update your payment method.' },
|
|
94
|
+
{ id: 'tab3', title: 'Preferences', content: 'Customize how the application looks and behaves to match your personal preferences.' }
|
|
95
|
+
]);
|
|
96
|
+
<\/script>
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
## Scrollable
|
|
100
|
+
|
|
101
|
+
Long tab lists are navigable by default; previous and next buttons appear automatically when the tabs overflow the available width.
|
|
102
|
+
|
|
103
|
+
```vue
|
|
104
|
+
<template>
|
|
105
|
+
<Tabs value="0" scrollable>
|
|
106
|
+
<TabList>
|
|
107
|
+
<Tab v-for="tab in scrollableTabs" :key="tab.value" :value="tab.value">{{ tab.title }}</Tab>
|
|
108
|
+
</TabList>
|
|
109
|
+
<TabPanels>
|
|
110
|
+
<TabPanel v-for="tab in scrollableTabs" :key="tab.value" :value="tab.value">
|
|
111
|
+
<h2 class="text-lg font-bold">{{ tab.title }}</h2>
|
|
112
|
+
<p class="text-surface-500 mt-1">{{ tab.content }}</p>
|
|
113
|
+
</TabPanel>
|
|
114
|
+
</TabPanels>
|
|
115
|
+
</Tabs>
|
|
116
|
+
</template>
|
|
117
|
+
|
|
118
|
+
<script setup>
|
|
119
|
+
import { ref } from 'vue';
|
|
120
|
+
|
|
121
|
+
const sentences = [
|
|
122
|
+
'Lorem ipsum dolor sit amet, consectetur adipiscing elit.',
|
|
123
|
+
'Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.',
|
|
124
|
+
'Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris.',
|
|
125
|
+
'Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore.',
|
|
126
|
+
'Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia.',
|
|
127
|
+
'Curabitur pretium tincidunt lacus, nec viverra velit semper at.',
|
|
128
|
+
'Fusce condimentum nunc ac nisi vulputate fringilla.',
|
|
129
|
+
'Donec fermentum porttitor nunc, vitae pellentesque tortor.',
|
|
130
|
+
'Pellentesque habitant morbi tristique senectus et netus et malesuada fames.',
|
|
131
|
+
'Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia.'
|
|
132
|
+
];
|
|
133
|
+
|
|
134
|
+
const scrollableTabs = ref(
|
|
135
|
+
Array.from({ length: 50 }, (_, i) => {
|
|
136
|
+
const start = i % sentences.length;
|
|
137
|
+
const content = Array.from({ length: 4 }, (_, j) => sentences[(start + j) % sentences.length]).join(' ');
|
|
138
|
+
|
|
139
|
+
return { title: \`Tab \${i + 1}\`, value: \`\${i}\`, content };
|
|
140
|
+
})
|
|
141
|
+
);
|
|
142
|
+
<\/script>
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
## Select on Focus
|
|
146
|
+
|
|
147
|
+
Set selectOnFocus to activate tabs on focus.
|
|
148
|
+
|
|
149
|
+
```vue
|
|
150
|
+
<template>
|
|
151
|
+
<Tabs value="tab1" selectOnFocus>
|
|
152
|
+
<TabList>
|
|
153
|
+
<Tab v-for="tab in tabs" :key="tab.id" :value="tab.id">{{ tab.title }}</Tab>
|
|
154
|
+
</TabList>
|
|
155
|
+
<TabPanels>
|
|
156
|
+
<TabPanel v-for="tab in tabs" :key="tab.id" :value="tab.id">
|
|
157
|
+
<h2 class="text-lg font-bold">{{ tab.title }}</h2>
|
|
158
|
+
<p class="text-surface-500 mt-1">{{ tab.content }}</p>
|
|
159
|
+
</TabPanel>
|
|
160
|
+
</TabPanels>
|
|
161
|
+
</Tabs>
|
|
162
|
+
</template>
|
|
163
|
+
|
|
164
|
+
<script setup>
|
|
165
|
+
import { ref } from 'vue';
|
|
166
|
+
|
|
167
|
+
const tabs = ref([
|
|
168
|
+
{ id: 'tab1', title: 'Account Info', content: 'Update your personal information such as name, email address, and profile picture.' },
|
|
169
|
+
{ id: 'tab2', title: 'Payment', content: 'Manage your subscription plan, view invoices, and update your payment method.' },
|
|
170
|
+
{ id: 'tab3', title: 'Preferences', content: 'Customize how the application looks and behaves to match your personal preferences.' }
|
|
171
|
+
]);
|
|
172
|
+
<\/script>
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
## Lazy
|
|
176
|
+
|
|
177
|
+
By default, inactive tab's content is rendered (but hidden). You can use the lazy property (either globally on Tabs or individually on a TabPanel ) to change this behavior so that content is only rendered when the tab becomes active. This is useful when a tab contains complex components that should only be initialized once the tab is activated.
|
|
178
|
+
|
|
179
|
+
```vue
|
|
180
|
+
<template>
|
|
181
|
+
<Tabs lazy value="0">
|
|
182
|
+
<TabList>
|
|
183
|
+
<Tab value="0">Header I</Tab>
|
|
184
|
+
<Tab value="1">Header II</Tab>
|
|
185
|
+
<Tab value="2">Header III</Tab>
|
|
186
|
+
</TabList>
|
|
187
|
+
<TabPanels>
|
|
188
|
+
<TabPanel value="0">
|
|
189
|
+
<p class="m-0 text-sm">
|
|
190
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
|
|
191
|
+
consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
|
|
192
|
+
</p>
|
|
193
|
+
</TabPanel>
|
|
194
|
+
<TabPanel value="1">
|
|
195
|
+
<p class="m-0 text-sm">
|
|
196
|
+
Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim
|
|
197
|
+
ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt. Consectetur, adipisci velit, sed quia non numquam eius modi.
|
|
198
|
+
</p>
|
|
199
|
+
</TabPanel>
|
|
200
|
+
<TabPanel value="2">
|
|
201
|
+
<p class="m-0 text-sm">Complex components that should only be initialized when the tab becomes active</p>
|
|
202
|
+
</TabPanel>
|
|
203
|
+
</TabPanels>
|
|
204
|
+
</Tabs>
|
|
205
|
+
</template>
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
## Disabled
|
|
209
|
+
|
|
210
|
+
Set disabled on a Tab to prevent selection.
|
|
211
|
+
|
|
212
|
+
```vue
|
|
213
|
+
<template>
|
|
214
|
+
<Tabs value="tab1">
|
|
215
|
+
<TabList>
|
|
216
|
+
<Tab value="tab1">Account Info</Tab>
|
|
217
|
+
<Tab value="tab2" disabled>Payment</Tab>
|
|
218
|
+
<Tab value="tab3">Preferences</Tab>
|
|
219
|
+
</TabList>
|
|
220
|
+
<TabPanels>
|
|
221
|
+
<TabPanel value="tab1">
|
|
222
|
+
<h2 class="text-lg font-bold">Account Info</h2>
|
|
223
|
+
<p class="text-surface-500 mt-1">Update your personal information such as name, email address, and profile picture.</p>
|
|
224
|
+
</TabPanel>
|
|
225
|
+
<TabPanel value="tab2">
|
|
226
|
+
<h2 class="text-lg font-bold">Payment</h2>
|
|
227
|
+
<p class="text-surface-500 mt-1">Manage your subscription plan, view invoices, and update your payment method.</p>
|
|
228
|
+
</TabPanel>
|
|
229
|
+
<TabPanel value="tab3">
|
|
230
|
+
<h2 class="text-lg font-bold">Preferences</h2>
|
|
231
|
+
<p class="text-surface-500 mt-1">Customize how the application looks and behaves to match your personal preferences.</p>
|
|
232
|
+
</TabPanel>
|
|
233
|
+
</TabPanels>
|
|
234
|
+
</Tabs>
|
|
235
|
+
</template>
|
|
236
|
+
```
|
|
237
|
+
|
|
238
|
+
## Custom Indicator
|
|
239
|
+
|
|
240
|
+
The active tab highlight can be restyled into a custom indicator through the activeBar pass through option, using the --px-active-bar-* CSS variables that hold the active tab's position and size.
|
|
241
|
+
|
|
242
|
+
```vue
|
|
243
|
+
<template>
|
|
244
|
+
<Tabs value="tab1">
|
|
245
|
+
<TabList
|
|
246
|
+
:pt="{
|
|
247
|
+
activeBar: {
|
|
248
|
+
class: 'w-[calc(var(--px-active-bar-width)-10px)]! h-[calc(var(--px-active-bar-height)-16px)]! left-[calc(var(--px-active-bar-left)+5px)]! top-[calc(var(--px-active-bar-top)+8px)]! bg-surface-100! dark:bg-surface-800! rounded-md! transition-[left,width]! duration-200!'
|
|
249
|
+
}
|
|
250
|
+
}"
|
|
251
|
+
>
|
|
252
|
+
<Tab v-for="tab in tabs" :key="tab.id" :value="tab.id" class="z-10">{{ tab.title }}</Tab>
|
|
253
|
+
</TabList>
|
|
254
|
+
<TabPanels>
|
|
255
|
+
<TabPanel v-for="tab in tabs" :key="tab.id" :value="tab.id">
|
|
256
|
+
<h2 class="text-lg font-bold">{{ tab.title }}</h2>
|
|
257
|
+
<p class="text-surface-500 mt-1">{{ tab.content }}</p>
|
|
258
|
+
</TabPanel>
|
|
259
|
+
</TabPanels>
|
|
260
|
+
</Tabs>
|
|
261
|
+
</template>
|
|
262
|
+
|
|
263
|
+
<script setup>
|
|
264
|
+
import { ref } from 'vue';
|
|
265
|
+
|
|
266
|
+
const tabs = ref([
|
|
267
|
+
{ id: 'tab1', title: 'Account Info', content: 'Update your personal information such as name, email address, and profile picture.' },
|
|
268
|
+
{ id: 'tab2', title: 'Payment', content: 'Manage your subscription plan, view invoices, and update your payment method.' },
|
|
269
|
+
{ id: 'tab3', title: 'Preferences', content: 'Customize how the application looks and behaves to match your personal preferences.' }
|
|
270
|
+
]);
|
|
271
|
+
<\/script>
|
|
272
|
+
```
|
|
273
|
+
|
|
274
|
+
## Template
|
|
275
|
+
|
|
276
|
+
Use custom markup inside tabs and panels to build richer tab content.
|
|
277
|
+
|
|
278
|
+
```vue
|
|
279
|
+
<template>
|
|
280
|
+
<Tabs value="tab1" class="max-w-md mx-auto">
|
|
281
|
+
<TabList>
|
|
282
|
+
<Tab value="tab1" class="flex items-center gap-2!">
|
|
283
|
+
<User />
|
|
284
|
+
Account Info
|
|
285
|
+
</Tab>
|
|
286
|
+
<Tab value="tab2" class="flex items-center gap-2!">
|
|
287
|
+
<CreditCard />
|
|
288
|
+
Payment
|
|
289
|
+
<Badge size="small" value="New" />
|
|
290
|
+
</Tab>
|
|
291
|
+
<Tab value="tab3" class="flex items-center gap-2!">
|
|
292
|
+
<Cog />
|
|
293
|
+
Preferences
|
|
294
|
+
</Tab>
|
|
295
|
+
</TabList>
|
|
296
|
+
<TabPanels>
|
|
297
|
+
<TabPanel value="tab1">
|
|
298
|
+
<div>
|
|
299
|
+
<p class="mt-2 mb-8 text-surface-500">Update your personal information such as name, email address, and profile picture.</p>
|
|
300
|
+
<div class="space-y-4">
|
|
301
|
+
<div class="flex flex-col gap-1">
|
|
302
|
+
<Label for="username">Username</Label>
|
|
303
|
+
<InputText id="username" placeholder="john.doe" />
|
|
304
|
+
</div>
|
|
305
|
+
<div class="flex flex-col gap-1">
|
|
306
|
+
<Label for="email">Email</Label>
|
|
307
|
+
<InputText id="email" placeholder="john.doe@example.com" />
|
|
308
|
+
</div>
|
|
309
|
+
</div>
|
|
310
|
+
<Button class="mt-8 w-fit">Save Changes</Button>
|
|
311
|
+
</div>
|
|
312
|
+
</TabPanel>
|
|
313
|
+
<TabPanel value="tab2">
|
|
314
|
+
<div>
|
|
315
|
+
<p class="mt-2 mb-8 text-surface-500">Manage your subscription plan, view invoices, and update your payment method.</p>
|
|
316
|
+
<div class="space-y-4">
|
|
317
|
+
<div class="flex flex-col gap-1">
|
|
318
|
+
<Label for="cardName">Cardholder Name</Label>
|
|
319
|
+
<InputText id="cardName" placeholder="John Doe" />
|
|
320
|
+
</div>
|
|
321
|
+
<div class="flex flex-col gap-1">
|
|
322
|
+
<Label for="cardNumber">Card Number</Label>
|
|
323
|
+
<InputText id="cardNumber" placeholder="0000 0000 0000 0000" />
|
|
324
|
+
</div>
|
|
325
|
+
<div class="flex flex-col gap-1">
|
|
326
|
+
<Label for="expiryDate">Expiry Date</Label>
|
|
327
|
+
<InputText id="expiryDate" placeholder="MM/YY" />
|
|
328
|
+
</div>
|
|
329
|
+
</div>
|
|
330
|
+
<Button class="mt-8 w-fit">Update Payment</Button>
|
|
331
|
+
</div>
|
|
332
|
+
</TabPanel>
|
|
333
|
+
<TabPanel value="tab3">
|
|
334
|
+
<div>
|
|
335
|
+
<p class="mt-2 mb-8 text-surface-500">Customize how the application looks and behaves to match your personal preferences.</p>
|
|
336
|
+
<div class="space-y-4">
|
|
337
|
+
<div class="flex items-center justify-between">
|
|
338
|
+
<Label for="darkMode">Dark Mode</Label>
|
|
339
|
+
<ToggleSwitch v-model="darkMode" inputId="darkMode" />
|
|
340
|
+
</div>
|
|
341
|
+
<div class="flex items-center justify-between">
|
|
342
|
+
<Label for="emailNotifications">Email Notifications</Label>
|
|
343
|
+
<ToggleSwitch v-model="emailNotifications" inputId="emailNotifications" />
|
|
344
|
+
</div>
|
|
345
|
+
<div class="flex items-center justify-between">
|
|
346
|
+
<Label for="desktopNotifications">Desktop Notifications</Label>
|
|
347
|
+
<ToggleSwitch v-model="desktopNotifications" inputId="desktopNotifications" />
|
|
348
|
+
</div>
|
|
349
|
+
</div>
|
|
350
|
+
<Button class="w-fit mt-8 ml-auto mr-0">Save Preferences</Button>
|
|
351
|
+
</div>
|
|
352
|
+
</TabPanel>
|
|
353
|
+
</TabPanels>
|
|
354
|
+
</Tabs>
|
|
355
|
+
</template>
|
|
356
|
+
|
|
357
|
+
<script setup>
|
|
358
|
+
import { ref } from 'vue';
|
|
359
|
+
import Cog from '@primeicons/vue/cog';
|
|
360
|
+
import CreditCard from '@primeicons/vue/credit-card';
|
|
361
|
+
import User from '@primeicons/vue/user';
|
|
362
|
+
|
|
363
|
+
const darkMode = ref(false);
|
|
364
|
+
const emailNotifications = ref(true);
|
|
365
|
+
const desktopNotifications = ref(false);
|
|
366
|
+
<\/script>
|
|
367
|
+
```
|
|
368
|
+
|
|
369
|
+
## Tab Menu
|
|
370
|
+
|
|
371
|
+
A navigation menu is implemented using tabs without the panels where the content of a tab is provided by a route component like router-view . For the purpose of this demo, router-view is not included.
|
|
372
|
+
|
|
373
|
+
```vue
|
|
374
|
+
<template>
|
|
375
|
+
<Tabs value="dashboard">
|
|
376
|
+
<TabList>
|
|
377
|
+
<Tab v-for="tab in tabs" :key="tab.route" :value="tab.route" as="div" class="flex items-center gap-2! text-inherit">
|
|
378
|
+
<router-link v-slot="{ href, navigate }" :to="tab.route" custom>
|
|
379
|
+
<a :href="href" @click="navigate" class="flex items-center gap-2 text-inherit">
|
|
380
|
+
<component :is="tab.icon" />
|
|
381
|
+
<span>{{ tab.label }}</span>
|
|
382
|
+
</a>
|
|
383
|
+
</router-link>
|
|
384
|
+
</Tab>
|
|
385
|
+
</TabList>
|
|
386
|
+
</Tabs>
|
|
387
|
+
<!-- <router-view /> -->
|
|
388
|
+
</template>
|
|
389
|
+
|
|
390
|
+
<script setup>
|
|
391
|
+
import ChartLine from '@primeicons/vue/chart-line';
|
|
392
|
+
import Home from '@primeicons/vue/home';
|
|
393
|
+
import Inbox from '@primeicons/vue/inbox';
|
|
394
|
+
import List from '@primeicons/vue/list';
|
|
395
|
+
|
|
396
|
+
const tabs = [
|
|
397
|
+
{ route: 'dashboard', label: 'Dashboard', icon: Home },
|
|
398
|
+
{ route: 'transactions', label: 'Transactions', icon: ChartLine },
|
|
399
|
+
{ route: 'products', label: 'Products', icon: List },
|
|
400
|
+
{ route: 'messages', label: 'Messages', icon: Inbox }
|
|
401
|
+
];
|
|
402
|
+
<\/script>
|
|
403
|
+
```
|
|
404
|
+
|
|
405
|
+
## Accessibility
|
|
406
|
+
|
|
407
|
+
Screen Reader The tabs container in TabList is defined with the tablist role, as any attribute is passed to the container element aria-labelledby can be optionally used to specify an element to describe the Tabs. Each Tab has a tab role along with aria-selected state attribute and aria-controls to refer to the corresponding TabPanel. TabPanel has tabpanel role, an id to match the aria-controls of Tab and aria-labelledby reference to Tab as the accessible name. Tab Keyboard Support Key Function tab Moves focus through the header. enter Activates the focused tab header. space Activates the focused tab header. right arrow Moves focus to the next header. If focus is on the last header, moves focus to the first header. left arrow Moves focus to the previous header. If focus is on the first header, moves focus to the last header. home Moves focus to the last header. end Moves focus to the first header. pageUp Moves scroll position to first header. pageDown Moves scroll position to last header.
|
|
408
|
+
|
|
409
|
+
## Tabs API
|
|
410
|
+
|
|
411
|
+
### Props
|
|
412
|
+
|
|
413
|
+
| Name |Type |Default |Description |
|
|
414
|
+
| --- | --- | --- | --- |
|
|
415
|
+
| value | string \| number | - | Value of the active tab. |
|
|
416
|
+
| lazy | boolean | false | When enabled, hidden tabs are not rendered at all. Defaults to false that hides tabs with css. |
|
|
417
|
+
| showNavigators | boolean | true | Whether to display navigation buttons when the tablist overflows. |
|
|
418
|
+
| tabindex | number | 0 | Index of the element in tabbing order. |
|
|
419
|
+
| selectOnFocus | boolean | false | When enabled, the focused tab is activated. |
|
|
420
|
+
| scrollable | boolean | false | When specified, enables horizontal and/or vertical scrolling. |
|
|
421
|
+
| scrollStrategy | "center" \| "nearest" \| Function | 'nearest' | Defines how the active tab is scrolled into view when it changes. - `'nearest'` : scrolls only if the tab is clipped or too close to an edge, with padding. - `'center'` : always centers the active tab in the viewport. - `function` : a custom scroll function receiving the content element and active tab element. |
|
|
422
|
+
| dt | any | - | It generates scoped CSS variables using design tokens for the component. |
|
|
423
|
+
| pt | PassThrough<TabsPassThroughOptions> | - | Used to pass attributes to DOM elements inside the component. |
|
|
424
|
+
| ptOptions | any | - | Used to configure passthrough(pt) options of the component. |
|
|
425
|
+
| unstyled | boolean | false | When enabled, it removes component related styles in the core. |
|
|
426
|
+
|
|
427
|
+
### Pass Through Options
|
|
428
|
+
|
|
429
|
+
| Name |Type |Description |
|
|
430
|
+
| --- | --- | --- |
|
|
431
|
+
| root | TabsPassThroughOptionType | Used to pass attributes to the root's DOM element. |
|
|
432
|
+
| hooks | any | Used to manage all lifecycle hooks. |
|
|
433
|
+
|
|
434
|
+
### Theming
|
|
435
|
+
|
|
436
|
+
### CSS Classes
|
|
437
|
+
|
|
438
|
+
| Class |Description |
|
|
439
|
+
| --- | --- |
|
|
440
|
+
| p-tabs | Class name of the root element |
|
|
441
|
+
|
|
442
|
+
### Design Tokens
|
|
443
|
+
|
|
444
|
+
| Token |CSS Variable |Description |
|
|
445
|
+
| --- | --- | --- |
|
|
446
|
+
| tabs.transition.duration | --p-tabs-transition-duration | Transition duration of root |
|
|
447
|
+
| tabs.tablist.border.width | --p-tabs-tablist-border-width | Border width of tablist |
|
|
448
|
+
| tabs.tablist.background | --p-tabs-tablist-background | Background of tablist |
|
|
449
|
+
| tabs.tablist.border.color | --p-tabs-tablist-border-color | Border color of tablist |
|
|
450
|
+
| tabs.tab.background | --p-tabs-tab-background | Background of tab |
|
|
451
|
+
| tabs.tab.hover.background | --p-tabs-tab-hover-background | Hover background of tab |
|
|
452
|
+
| tabs.tab.active.background | --p-tabs-tab-active-background | Active background of tab |
|
|
453
|
+
| tabs.tab.border.width | --p-tabs-tab-border-width | Border width of tab |
|
|
454
|
+
| tabs.tab.border.color | --p-tabs-tab-border-color | Border color of tab |
|
|
455
|
+
| tabs.tab.hover.border.color | --p-tabs-tab-hover-border-color | Hover border color of tab |
|
|
456
|
+
| tabs.tab.active.border.color | --p-tabs-tab-active-border-color | Active border color of tab |
|
|
457
|
+
| tabs.tab.color | --p-tabs-tab-color | Color of tab |
|
|
458
|
+
| tabs.tab.hover.color | --p-tabs-tab-hover-color | Hover color of tab |
|
|
459
|
+
| tabs.tab.active.color | --p-tabs-tab-active-color | Active color of tab |
|
|
460
|
+
| tabs.tab.padding | --p-tabs-tab-padding | Padding of tab |
|
|
461
|
+
| tabs.tab.font.weight | --p-tabs-tab-font-weight | Font weight of tab |
|
|
462
|
+
| tabs.tab.font.size | --p-tabs-tab-font-size | Font size of tab |
|
|
463
|
+
| tabs.tab.margin | --p-tabs-tab-margin | Margin of tab |
|
|
464
|
+
| tabs.tab.gap | --p-tabs-tab-gap | Gap of tab |
|
|
465
|
+
| tabs.tab.focus.ring.width | --p-tabs-tab-focus-ring-width | Focus ring width of tab |
|
|
466
|
+
| tabs.tab.focus.ring.style | --p-tabs-tab-focus-ring-style | Focus ring style of tab |
|
|
467
|
+
| tabs.tab.focus.ring.color | --p-tabs-tab-focus-ring-color | Focus ring color of tab |
|
|
468
|
+
| tabs.tab.focus.ring.offset | --p-tabs-tab-focus-ring-offset | Focus ring offset of tab |
|
|
469
|
+
| tabs.tab.focus.ring.shadow | --p-tabs-tab-focus-ring-shadow | Focus ring shadow of tab |
|
|
470
|
+
| tabs.tabpanel.background | --p-tabs-tabpanel-background | Background of tabpanel |
|
|
471
|
+
| tabs.tabpanel.color | --p-tabs-tabpanel-color | Color of tabpanel |
|
|
472
|
+
| tabs.tabpanel.padding | --p-tabs-tabpanel-padding | Padding of tabpanel |
|
|
473
|
+
| tabs.tabpanel.focus.ring.width | --p-tabs-tabpanel-focus-ring-width | Focus ring width of tabpanel |
|
|
474
|
+
| tabs.tabpanel.focus.ring.style | --p-tabs-tabpanel-focus-ring-style | Focus ring style of tabpanel |
|
|
475
|
+
| tabs.tabpanel.focus.ring.color | --p-tabs-tabpanel-focus-ring-color | Focus ring color of tabpanel |
|
|
476
|
+
| tabs.tabpanel.focus.ring.offset | --p-tabs-tabpanel-focus-ring-offset | Focus ring offset of tabpanel |
|
|
477
|
+
| tabs.tabpanel.focus.ring.shadow | --p-tabs-tabpanel-focus-ring-shadow | Focus ring shadow of tabpanel |
|
|
478
|
+
| tabs.nav.button.background | --p-tabs-nav-button-background | Background of nav button |
|
|
479
|
+
| tabs.nav.button.color | --p-tabs-nav-button-color | Color of nav button |
|
|
480
|
+
| tabs.nav.button.hover.color | --p-tabs-nav-button-hover-color | Hover color of nav button |
|
|
481
|
+
| tabs.nav.button.width | --p-tabs-nav-button-width | Width of nav button |
|
|
482
|
+
| tabs.nav.button.focus.ring.width | --p-tabs-nav-button-focus-ring-width | Focus ring width of nav button |
|
|
483
|
+
| tabs.nav.button.focus.ring.style | --p-tabs-nav-button-focus-ring-style | Focus ring style of nav button |
|
|
484
|
+
| tabs.nav.button.focus.ring.color | --p-tabs-nav-button-focus-ring-color | Focus ring color of nav button |
|
|
485
|
+
| tabs.nav.button.focus.ring.offset | --p-tabs-nav-button-focus-ring-offset | Focus ring offset of nav button |
|
|
486
|
+
| tabs.nav.button.focus.ring.shadow | --p-tabs-nav-button-focus-ring-shadow | Focus ring shadow of nav button |
|
|
487
|
+
| tabs.nav.button.shadow | --p-tabs-nav-button-shadow | Shadow of nav button |
|
|
488
|
+
| tabs.active.bar.height | --p-tabs-active-bar-height | Height of active bar |
|
|
489
|
+
| tabs.active.bar.bottom | --p-tabs-active-bar-bottom | Bottom of active bar |
|
|
490
|
+
| tabs.active.bar.background | --p-tabs-active-bar-background | Background of active bar |
|
|
491
|
+
|
|
492
|
+
## Tab List API
|
|
493
|
+
|
|
494
|
+
### Props
|
|
495
|
+
|
|
496
|
+
| Name |Type |Default |Description |
|
|
497
|
+
| --- | --- | --- | --- |
|
|
498
|
+
| dt | any | - | It generates scoped CSS variables using design tokens for the component. |
|
|
499
|
+
| pt | PassThrough<TabListPassThroughOptions> | - | Used to pass attributes to DOM elements inside the component. |
|
|
500
|
+
| ptOptions | any | - | Used to configure passthrough(pt) options of the component. |
|
|
501
|
+
| unstyled | boolean | false | When enabled, it removes component related styles in the core. |
|
|
502
|
+
|
|
503
|
+
### Pass Through Options
|
|
504
|
+
|
|
505
|
+
| Name |Type |Description |
|
|
506
|
+
| --- | --- | --- |
|
|
507
|
+
| root | TabListPassThroughOptionType | Used to pass attributes to the root's DOM element. |
|
|
508
|
+
| prevButton | TabListPassThroughOptionType | Used to pass attributes to the previous button component. |
|
|
509
|
+
| nextButton | TabListPassThroughOptionType | Used to pass attributes to the next button component. |
|
|
510
|
+
| content | TabListPassThroughOptionType | Used to pass attributes to the content's DOM element. |
|
|
511
|
+
| activeBar | TabListPassThroughOptionType | Used to pass attributes to the inkbar's DOM element. |
|
|
512
|
+
| hooks | any | Used to manage all lifecycle hooks. |
|
|
513
|
+
|
|
514
|
+
### Theming
|
|
515
|
+
|
|
516
|
+
### CSS Classes
|
|
517
|
+
|
|
518
|
+
| Class |Description |
|
|
519
|
+
| --- | --- |
|
|
520
|
+
| p-tablist | Class name of the root element |
|
|
521
|
+
| p-tablist-content | Class name of the content element |
|
|
522
|
+
| p-tablist-active-bar | Class name of the activebar element |
|
|
523
|
+
| p-tablist-prev-button | Class name of the previous button element |
|
|
524
|
+
| p-tablist-next-button | Class name of the next button element |
|
|
525
|
+
|
|
526
|
+
## Tab API
|
|
527
|
+
|
|
528
|
+
### Props
|
|
529
|
+
|
|
530
|
+
| Name |Type |Default |Description |
|
|
531
|
+
| --- | --- | --- | --- |
|
|
532
|
+
| value | string \| number | - | Value of tab. |
|
|
533
|
+
| disabled | boolean | false | Whether the tab is disabled. |
|
|
534
|
+
| as | string \| Component | BUTTON | Use to change the HTML tag of root element. |
|
|
535
|
+
| asChild | boolean | false | When enabled, it changes the default rendered element for the one passed as a child element. |
|
|
536
|
+
| dt | any | - | It generates scoped CSS variables using design tokens for the component. |
|
|
537
|
+
| pt | PassThrough<TabPassThroughOptions> | - | Used to pass attributes to DOM elements inside the component. |
|
|
538
|
+
| ptOptions | any | - | Used to configure passthrough(pt) options of the component. |
|
|
539
|
+
| unstyled | boolean | false | When enabled, it removes component related styles in the core. |
|
|
540
|
+
|
|
541
|
+
### Pass Through Options
|
|
542
|
+
|
|
543
|
+
| Name |Type |Description |
|
|
544
|
+
| --- | --- | --- |
|
|
545
|
+
| root | TabPassThroughOptionType | Used to pass attributes to the root's DOM element. |
|
|
546
|
+
| hooks | any | Used to manage all lifecycle hooks. |
|
|
547
|
+
|
|
548
|
+
### Theming
|
|
549
|
+
|
|
550
|
+
### CSS Classes
|
|
551
|
+
|
|
552
|
+
| Class |Description |
|
|
553
|
+
| --- | --- |
|
|
554
|
+
| p-tab | Class name of the root element |
|
|
555
|
+
|
|
556
|
+
## Tab Panels API
|
|
557
|
+
|
|
558
|
+
### Props
|
|
559
|
+
|
|
560
|
+
| Name |Type |Default |Description |
|
|
561
|
+
| --- | --- | --- | --- |
|
|
562
|
+
| dt | any | - | It generates scoped CSS variables using design tokens for the component. |
|
|
563
|
+
| pt | PassThrough<TabPanelsPassThroughOptions> | - | Used to pass attributes to DOM elements inside the component. |
|
|
564
|
+
| ptOptions | any | - | Used to configure passthrough(pt) options of the component. |
|
|
565
|
+
| unstyled | boolean | false | When enabled, it removes component related styles in the core. |
|
|
566
|
+
|
|
567
|
+
### Pass Through Options
|
|
568
|
+
|
|
569
|
+
| Name |Type |Description |
|
|
570
|
+
| --- | --- | --- |
|
|
571
|
+
| root | TabPanelsPassThroughOptionType | Used to pass attributes to the root's DOM element. |
|
|
572
|
+
| hooks | any | Used to manage all lifecycle hooks. |
|
|
573
|
+
|
|
574
|
+
### Theming
|
|
575
|
+
|
|
576
|
+
### CSS Classes
|
|
577
|
+
|
|
578
|
+
| Class |Description |
|
|
579
|
+
| --- | --- |
|
|
580
|
+
| p-tabpanels | Class name of the root element |
|
|
581
|
+
|
|
582
|
+
## Tab Panel API
|
|
583
|
+
|
|
584
|
+
### Props
|
|
585
|
+
|
|
586
|
+
| Name |Type |Default |Description |
|
|
587
|
+
| --- | --- | --- | --- |
|
|
588
|
+
| value | string \| number | - | Value of tabpanel. |
|
|
589
|
+
| as | string \| Component | DIV | Use to change the HTML tag of root element. |
|
|
590
|
+
| asChild | boolean | false | When enabled, it changes the default rendered element for the one passed as a child element. |
|
|
591
|
+
| dt | any | - | It generates scoped CSS variables using design tokens for the component. |
|
|
592
|
+
| pt | PassThrough<TabPanelPassThroughOptions> | - | Used to pass attributes to DOM elements inside the component. |
|
|
593
|
+
| ptOptions | any | - | Used to configure passthrough(pt) options of the component. |
|
|
594
|
+
| unstyled | boolean | false | When enabled, it removes component related styles in the core. |
|
|
595
|
+
|
|
596
|
+
### Pass Through Options
|
|
597
|
+
|
|
598
|
+
| Name |Type |Description |
|
|
599
|
+
| --- | --- | --- |
|
|
600
|
+
| root | TabPanelPassThroughOptionType | Used to pass attributes to the root's DOM element. |
|
|
601
|
+
| hooks | any | Used to manage all lifecycle hooks. |
|
|
602
|
+
|
|
603
|
+
### Theming
|
|
604
|
+
|
|
605
|
+
### CSS Classes
|
|
606
|
+
|
|
607
|
+
| Class |Description |
|
|
608
|
+
| --- | --- |
|
|
609
|
+
| p-tabpanel | Class name of the root element |
|