@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,497 @@
|
|
|
1
|
+
# Styled Mode
|
|
2
|
+
|
|
3
|
+
Choose from a variety of pre-styled themes or develop your own.
|
|
4
|
+
|
|
5
|
+
## Architecture
|
|
6
|
+
|
|
7
|
+
PrimeVue is a design agnostic library so unlike some other UI libraries it does not enforce a certain styling such as material design. Styling is decoupled from the components using the themes instead. A theme consists of two parts; base and preset . The base is the style rules with CSS variables as placeholders whereas the preset is a set of design tokens to feed a base by mapping the tokens to CSS variables. A base may be configured with different presets, currently Aura, Material, Lara and Nora are the available built-in options. The core of the styled mode architecture is based on a concept named design token , a preset defines the token configuration in 3 tiers; primitive , semantic and component . Learn more about design tokens at the Design Tokens Format Module specification. Primitive Tokens Primitive tokens have no context, a color palette is a good example for a primitive token such as blue-50 to blue-900 . A token named blue-500 may be used as the primary color, the background of a message however on its own, the name of the token does not indicate context. Usually they are utilized by the semantic tokens. Semantic Tokens Semantic tokens define content and their names indicate where they are utilized, a well known example of a semantic token is the primary.color . Semantic tokens map to primitive tokens or other semantic tokens. The colorScheme token group is a special variable to define tokens based on the color scheme active in the application, this allows defining different tokens based on the color scheme like dark mode. Component Tokens Component tokens are isolated tokens per component such as inputtext.background or button.color that map to the semantic tokens. As an example, button.background component token maps to the primary.color semantic token which maps to the green.500 primitive token. Best Practices Use primitive tokens when defining the core color palette and semantic tokens to specify the common design elements such as focus ring, primary colors and surfaces. Components tokens should only be used when customizing a specific component. By defining your own design tokens as a custom preset, you'll be able to define your own style without touching CSS. Overriding the PrimeVue components using style classes is not a best practice and should be the last resort, design tokens are the suggested approach.
|
|
8
|
+
|
|
9
|
+
## Theme
|
|
10
|
+
|
|
11
|
+
The theme property is used to customize the initial theme.
|
|
12
|
+
|
|
13
|
+
```vue
|
|
14
|
+
import PrimeVue from 'primevue/config';
|
|
15
|
+
import Aura from '@primeuix/themes/aura';
|
|
16
|
+
|
|
17
|
+
const app = createApp(App);
|
|
18
|
+
|
|
19
|
+
app.use(PrimeVue, {
|
|
20
|
+
|
|
21
|
+
theme: {
|
|
22
|
+
preset: Aura,
|
|
23
|
+
// Default options
|
|
24
|
+
options: {
|
|
25
|
+
prefix: 'p',
|
|
26
|
+
darkModeSelector: 'system',
|
|
27
|
+
cssLayer: false,
|
|
28
|
+
cssVariables: true
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## Options
|
|
35
|
+
|
|
36
|
+
The options property defines the how the CSS would be generated from the design tokens of the preset. prefix The prefix of the CSS variables, defaults to p . For instance, the primary.color design token would be var(--p-primary-color) . darkModeSelector The CSS rule to encapsulate the CSS variables of the dark mode, the default is the system to generate @media (prefers-color-scheme: dark) . If you need to make the dark mode toggleable based on the user selection define a class selector such as .app-dark and toggle this class at the document root. See the dark mode toggle section for an example. cssLayer Defines whether the styles should be defined inside a CSS layer by default or not. A CSS layer would be handy to declare a custom cascade layer for easier customization if necessary. The default is false . cssVariables Controls whether component design tokens are generated as CSS variables or inlined as static values. Primitive and semantic tokens are always generated as CSS variables.
|
|
37
|
+
|
|
38
|
+
## Presets
|
|
39
|
+
|
|
40
|
+
Aura, Material, Lara and Nora are the available built-in options, created to demonstrate the power of the design-agnostic theming. Aura is PrimeTek's own vision, Material follows Google Material Design v2, Lara is based on Bootstrap and Nora is inspired by enterprise applications. Visit the source code to learn more about the structure of presets. You may use them out of the box with modifications or utilize them as reference in case you need to build your own presets from scratch.
|
|
41
|
+
|
|
42
|
+
## Base Font Size
|
|
43
|
+
|
|
44
|
+
PrimeVue sizes its components in rem units relative to the document root font size, which it assumes to be 16px , the browser default. Earlier versions assumed 14px for historical reasons, so to avoid disrupting existing layouts every preset also ships a compat variant calibrated for a 14px root. The compat variants are maintained until June 2027 . When migrating an existing application that uses 14px base font to PrimeVue v5 or newer, the recommended path is to switch to the compat preset first to preserve the current appearance, then set the document root size to 16px and move to the standard (non-compat) preset once the rest of the application has been migrated to the 16px baseline. If your application already uses a 16px document root, no change is required and you can use the standard presets directly. Preset 16px 14px (Legacy) Aura @primeuix/themes/aura @primeuix/themes/aura-compat Lara @primeuix/themes/lara @primeuix/themes/lara-compat Material @primeuix/themes/material @primeuix/themes/material-compat Nora @primeuix/themes/nora @primeuix/themes/nora-compat
|
|
45
|
+
|
|
46
|
+
## Reserved Keys
|
|
47
|
+
|
|
48
|
+
Following keys are reserved in the preset scheme and cannot be used as a token name; primitive , semantic , components , directives , colorscheme , light , dark , common , root , states , and extend .
|
|
49
|
+
|
|
50
|
+
## Colors
|
|
51
|
+
|
|
52
|
+
Color palette of a preset is defined by the primitive design token group. You can access colors using CSS variables or the $dt utility.
|
|
53
|
+
|
|
54
|
+
## Dark Mode
|
|
55
|
+
|
|
56
|
+
PrimeVue uses the system as the default darkModeSelector in theme configuration. If you have a dark mode switch in your application, set the darkModeSelector to the selector you utilize such as .my-app-dark so that PrimeVue can fit in seamlessly with your color scheme. Following is a very basic example implementation of a dark mode switch, you may extend it further by involving prefers-color-scheme to retrieve it from the system initially and use localStorage to make it stateful. See this article for more information. In case you prefer to use dark mode all the time, apply the darkModeSelector initially and never change it. It is also possible to disable dark mode completely using false or none as the value of the selector.
|
|
57
|
+
|
|
58
|
+
## definePreset
|
|
59
|
+
|
|
60
|
+
The definePreset utility is used to customize an existing preset during the PrimeVue setup. The first parameter is the preset to customize and the second is the design tokens to override.
|
|
61
|
+
|
|
62
|
+
```vue
|
|
63
|
+
import PrimeVue from 'primevue/config';
|
|
64
|
+
import { definePreset } from '@primeuix/themes';
|
|
65
|
+
import Aura from '@primeuix/themes/aura';
|
|
66
|
+
|
|
67
|
+
const MyPreset = definePreset(Aura, {
|
|
68
|
+
//Your customizations, see the following sections for examples
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
app.use(PrimeVue, {
|
|
72
|
+
theme: {
|
|
73
|
+
preset: MyPreset
|
|
74
|
+
}
|
|
75
|
+
});
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
## Color Scheme
|
|
79
|
+
|
|
80
|
+
Tokens can be defined per color scheme using the light-dark keyword, allowing each token to hold scheme-specific values.
|
|
81
|
+
|
|
82
|
+
```vue
|
|
83
|
+
import PrimeVue from 'primevue/config';
|
|
84
|
+
import { definePreset } from '@primeuix/themes';
|
|
85
|
+
import Aura from '@primeuix/themes/aura';
|
|
86
|
+
|
|
87
|
+
const MyPreset = definePreset(Aura, {
|
|
88
|
+
semantic: {
|
|
89
|
+
primary: {
|
|
90
|
+
color: 'light-dark({primary.500}, {primary.400})',
|
|
91
|
+
contrastColor: 'light-dark(#ffffff, {surface.900})'
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
});
|
|
95
|
+
|
|
96
|
+
app.use(PrimeVue, {
|
|
97
|
+
theme: {
|
|
98
|
+
preset: MyPreset
|
|
99
|
+
}
|
|
100
|
+
});
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
## Primary
|
|
104
|
+
|
|
105
|
+
The primary defines the main color palette, default value maps to the emerald primitive token. Let's setup to use indigo instead.
|
|
106
|
+
|
|
107
|
+
```vue
|
|
108
|
+
const MyPreset = definePreset(Aura, {
|
|
109
|
+
semantic: {
|
|
110
|
+
primary: {
|
|
111
|
+
50: '{indigo.50}',
|
|
112
|
+
100: '{indigo.100}',
|
|
113
|
+
200: '{indigo.200}',
|
|
114
|
+
300: '{indigo.300}',
|
|
115
|
+
400: '{indigo.400}',
|
|
116
|
+
500: '{indigo.500}',
|
|
117
|
+
600: '{indigo.600}',
|
|
118
|
+
700: '{indigo.700}',
|
|
119
|
+
800: '{indigo.800}',
|
|
120
|
+
900: '{indigo.900}',
|
|
121
|
+
950: '{indigo.950}'
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
});
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
## Surface
|
|
128
|
+
|
|
129
|
+
The color scheme palette that varies between light and dark modes is specified with the surface tokens. Example below uses stone for light mode and zinc for dark mode. With this setting, light mode, would have a grayscale tone and dark mode would include bluish tone.
|
|
130
|
+
|
|
131
|
+
```vue
|
|
132
|
+
const MyPreset = definePreset(Aura, {
|
|
133
|
+
semantic: {
|
|
134
|
+
surface: {
|
|
135
|
+
0: '#ffffff',
|
|
136
|
+
50: 'light-dark({stone.50}, {zinc.50})',
|
|
137
|
+
100: 'light-dark({stone.100}, {zinc.100})',
|
|
138
|
+
200: 'light-dark({stone.200}, {zinc.200})',
|
|
139
|
+
300: 'light-dark({stone.300}, {zinc.300})',
|
|
140
|
+
400: 'light-dark({stone.400}, {zinc.400})',
|
|
141
|
+
500: 'light-dark({stone.500}, {zinc.500})',
|
|
142
|
+
600: 'light-dark({stone.600}, {zinc.600})',
|
|
143
|
+
700: 'light-dark({stone.700}, {zinc.700})',
|
|
144
|
+
800: 'light-dark({stone.800}, {zinc.800})',
|
|
145
|
+
900: 'light-dark({stone.900}, {zinc.900})',
|
|
146
|
+
950: 'light-dark({stone.950}, {zinc.950})'
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
});
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
## Noir
|
|
153
|
+
|
|
154
|
+
The noir mode is a sleek, monochrome variant where the primary color is derived from the neutral surface palette instead of a distinct accent color. The example below maps the primary palette to surface tones and uses the light-dark function to define the light and dark values of the primary and highlight tokens in a single place;
|
|
155
|
+
|
|
156
|
+
```vue
|
|
157
|
+
const Noir = definePreset(Aura, {
|
|
158
|
+
semantic: {
|
|
159
|
+
primary: {
|
|
160
|
+
50: '{surface.50}',
|
|
161
|
+
100: '{surface.100}',
|
|
162
|
+
200: '{surface.200}',
|
|
163
|
+
300: '{surface.300}',
|
|
164
|
+
400: '{surface.400}',
|
|
165
|
+
500: '{surface.500}',
|
|
166
|
+
600: '{surface.600}',
|
|
167
|
+
700: '{surface.700}',
|
|
168
|
+
800: '{surface.800}',
|
|
169
|
+
900: '{surface.900}',
|
|
170
|
+
950: '{surface.950}',
|
|
171
|
+
color: 'light-dark({primary.950}, {primary.50})',
|
|
172
|
+
contrastColor: 'light-dark(#ffffff, {primary.950})',
|
|
173
|
+
hoverColor: 'light-dark({primary.800}, {primary.200})',
|
|
174
|
+
activeColor: 'light-dark({primary.700}, {primary.300})'
|
|
175
|
+
},
|
|
176
|
+
highlight: {
|
|
177
|
+
background: 'light-dark({primary.950}, {primary.50})',
|
|
178
|
+
focusBackground: 'light-dark({primary.700}, {primary.300})',
|
|
179
|
+
color: 'light-dark(#ffffff, {primary.950})',
|
|
180
|
+
focusColor: 'light-dark(#ffffff, {primary.950})'
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
});
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
## Forms
|
|
187
|
+
|
|
188
|
+
The design tokens of the form input components are derived from the form.field token group. This customization example changes border color to primary on hover. Any component that depends on this semantic token such as dropdown.hover.border.color and textarea.hover.border.color would receive the change.
|
|
189
|
+
|
|
190
|
+
```vue
|
|
191
|
+
const MyPreset = definePreset(Aura, {
|
|
192
|
+
semantic: {
|
|
193
|
+
formField: {
|
|
194
|
+
hoverBorderColor: '{primary.color}'
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
});
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
## Focus Ring
|
|
201
|
+
|
|
202
|
+
Focus ring defines the outline width, style, color and offset. Let's use a thicker ring with the primary color for the outline.
|
|
203
|
+
|
|
204
|
+
```vue
|
|
205
|
+
const MyPreset = definePreset(Aura, {
|
|
206
|
+
semantic: {
|
|
207
|
+
focusRing: {
|
|
208
|
+
width: '2px',
|
|
209
|
+
style: 'dashed',
|
|
210
|
+
color: '{primary.color}',
|
|
211
|
+
offset: '1px'
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
});
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
## Component
|
|
218
|
+
|
|
219
|
+
The design tokens of a specific component is defined at components layer. This configuration is global and applies to all card components, in case you need to customize a particular component on a page locally, view the Scoped CSS section for an example. Tip : Overriding component tokens is best suited for small adjustments. For heavy customization, building your own preset is the recommended approach.
|
|
220
|
+
|
|
221
|
+
```vue
|
|
222
|
+
const MyPreset = definePreset(Aura, {
|
|
223
|
+
components: {
|
|
224
|
+
card: {
|
|
225
|
+
root: {
|
|
226
|
+
background: 'light-dark({surface.0}, {surface.900})',
|
|
227
|
+
color: 'light-dark({surface.700}, {surface.0})'
|
|
228
|
+
},
|
|
229
|
+
subtitle: {
|
|
230
|
+
color: 'light-dark({surface.500}, {surface.400})'
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
});
|
|
235
|
+
```
|
|
236
|
+
|
|
237
|
+
## Typography
|
|
238
|
+
|
|
239
|
+
Typography tokens are defined at the semantic level for consistency and at the component level for specialization.
|
|
240
|
+
|
|
241
|
+
```vue
|
|
242
|
+
const MyPreset = definePreset(Aura, {
|
|
243
|
+
semantic: {
|
|
244
|
+
typography: {
|
|
245
|
+
lineHeight: '1.5',
|
|
246
|
+
fontFamily: 'inherit',
|
|
247
|
+
fontWeight: 'normal',
|
|
248
|
+
fontSize: '0.875rem'
|
|
249
|
+
},
|
|
250
|
+
formField: {
|
|
251
|
+
fontWeight: '{typography.font.weight}',
|
|
252
|
+
fontSize: '{typography.font.size}'
|
|
253
|
+
}
|
|
254
|
+
},
|
|
255
|
+
components: {
|
|
256
|
+
select: {
|
|
257
|
+
fontSize: '{form.field.font.size}',
|
|
258
|
+
fontWeight: '{form.field.font.weight}'
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
});
|
|
262
|
+
```
|
|
263
|
+
|
|
264
|
+
## Extend
|
|
265
|
+
|
|
266
|
+
The theming system can be extended by adding custom design tokens and additional styles. This feature provides a high degree of customization, allowing you to adjust styles according to your needs, as you are not limited to the default tokens. The example preset configuration adds a new accent button with custom button.accent.color and button.accent.inverse.color tokens. It is also possible to add tokens globally to share them within the components.
|
|
267
|
+
|
|
268
|
+
```vue
|
|
269
|
+
const MyPreset = definePreset(Aura, {
|
|
270
|
+
components: {
|
|
271
|
+
// custom button tokens and additional style
|
|
272
|
+
button: {
|
|
273
|
+
extend: {
|
|
274
|
+
accent: {
|
|
275
|
+
color: '#f59e0b',
|
|
276
|
+
inverseColor: '#ffffff'
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
css: ({ dt }) => \`
|
|
280
|
+
.p-button-accent {
|
|
281
|
+
background: \${dt('button.accent.color')};
|
|
282
|
+
color: \${dt('button.accent.inverse.color')};
|
|
283
|
+
transition-duration: \${dt('my.transition.fast')};
|
|
284
|
+
}
|
|
285
|
+
\`
|
|
286
|
+
}
|
|
287
|
+
},
|
|
288
|
+
// common tokens and styles
|
|
289
|
+
extend: {
|
|
290
|
+
my: {
|
|
291
|
+
transition: {
|
|
292
|
+
slow: '0.75s'
|
|
293
|
+
normal: '0.5s'
|
|
294
|
+
fast: '0.25s'
|
|
295
|
+
},
|
|
296
|
+
imageDisplay: 'block'
|
|
297
|
+
}
|
|
298
|
+
},
|
|
299
|
+
css: ({ dt }) => \`
|
|
300
|
+
/* Global CSS */
|
|
301
|
+
img {
|
|
302
|
+
display: \${dt('my.image.display')};
|
|
303
|
+
}
|
|
304
|
+
\`
|
|
305
|
+
});
|
|
306
|
+
```
|
|
307
|
+
|
|
308
|
+
## Scoped Tokens
|
|
309
|
+
|
|
310
|
+
Design tokens can be scoped to a certain component using the dt property. In this example, first switch uses the global tokens whereas second one overrides the global with its own tokens. This approach is recommended over the :deep() as it offers a cleaner API while avoiding the hassle of CSS rule overrides.
|
|
311
|
+
|
|
312
|
+
## usePreset
|
|
313
|
+
|
|
314
|
+
Replaces the current presets entirely, common use case is changing the preset dynamically at runtime.
|
|
315
|
+
|
|
316
|
+
```vue
|
|
317
|
+
import { usePreset } from '@primeuix/themes';
|
|
318
|
+
|
|
319
|
+
const onButtonClick() {
|
|
320
|
+
usePreset(MyPreset);
|
|
321
|
+
}
|
|
322
|
+
```
|
|
323
|
+
|
|
324
|
+
## updatePreset
|
|
325
|
+
|
|
326
|
+
Merges the provided tokens to the current preset, an example would be changing the primary color palette dynamically.
|
|
327
|
+
|
|
328
|
+
```vue
|
|
329
|
+
import { updatePreset } from '@primeuix/themes';
|
|
330
|
+
|
|
331
|
+
const changePrimaryColor() {
|
|
332
|
+
updatePreset({
|
|
333
|
+
semantic: {
|
|
334
|
+
primary: {
|
|
335
|
+
50: '{indigo.50}',
|
|
336
|
+
100: '{indigo.100}',
|
|
337
|
+
200: '{indigo.200}',
|
|
338
|
+
300: '{indigo.300}',
|
|
339
|
+
400: '{indigo.400}',
|
|
340
|
+
500: '{indigo.500}',
|
|
341
|
+
600: '{indigo.600}',
|
|
342
|
+
700: '{indigo.700}',
|
|
343
|
+
800: '{indigo.800}',
|
|
344
|
+
900: '{indigo.900}',
|
|
345
|
+
950: '{indigo.950}'
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
})
|
|
349
|
+
}
|
|
350
|
+
```
|
|
351
|
+
|
|
352
|
+
## updatePrimaryPalette
|
|
353
|
+
|
|
354
|
+
Updates the primary colors, this is a shorthand to do the same update using updatePreset .
|
|
355
|
+
|
|
356
|
+
```vue
|
|
357
|
+
import { updatePrimaryPalette } from '@primeuix/themes';
|
|
358
|
+
|
|
359
|
+
const changePrimaryColor() {
|
|
360
|
+
updatePrimaryPalette({
|
|
361
|
+
50: '{indigo.50}',
|
|
362
|
+
100: '{indigo.100}',
|
|
363
|
+
200: '{indigo.200}',
|
|
364
|
+
300: '{indigo.300}',
|
|
365
|
+
400: '{indigo.400}',
|
|
366
|
+
500: '{indigo.500}',
|
|
367
|
+
600: '{indigo.600}',
|
|
368
|
+
700: '{indigo.700}',
|
|
369
|
+
800: '{indigo.800}',
|
|
370
|
+
900: '{indigo.900}',
|
|
371
|
+
950: '{indigo.950}'
|
|
372
|
+
});
|
|
373
|
+
}
|
|
374
|
+
```
|
|
375
|
+
|
|
376
|
+
## updateSurfacePalette
|
|
377
|
+
|
|
378
|
+
Updates the surface colors, this is a shorthand to do the same update using updatePreset .
|
|
379
|
+
|
|
380
|
+
```vue
|
|
381
|
+
import { updateSurfacePalette } from '@primeuix/themes';
|
|
382
|
+
|
|
383
|
+
const changeSurfaces() {
|
|
384
|
+
//changes surfaces both in light and dark mode
|
|
385
|
+
updateSurfacePalette({
|
|
386
|
+
50: '{zinc.50}',
|
|
387
|
+
// ...
|
|
388
|
+
950: '{zinc.950}'
|
|
389
|
+
});
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
const changeLightSurfaces() {
|
|
393
|
+
//changes surfaces only in light
|
|
394
|
+
updateSurfacePalette({
|
|
395
|
+
light: {
|
|
396
|
+
50: '{zinc.50}',
|
|
397
|
+
// ...
|
|
398
|
+
950: '{zinc.950}'
|
|
399
|
+
}
|
|
400
|
+
});
|
|
401
|
+
}
|
|
402
|
+
|
|
403
|
+
const changeDarkSurfaces() {
|
|
404
|
+
//changes surfaces only in dark mode
|
|
405
|
+
updateSurfacePalette({
|
|
406
|
+
dark: {
|
|
407
|
+
50: '{zinc.50}',
|
|
408
|
+
// ...
|
|
409
|
+
950: '{zinc.950}'
|
|
410
|
+
}
|
|
411
|
+
});
|
|
412
|
+
}
|
|
413
|
+
```
|
|
414
|
+
|
|
415
|
+
## $dt
|
|
416
|
+
|
|
417
|
+
The $dt function returns the information about a token like the full path and value. This would be useful if you need to access tokens programmatically.
|
|
418
|
+
|
|
419
|
+
```vue
|
|
420
|
+
import { $dt } from '@primeuix/themes';
|
|
421
|
+
|
|
422
|
+
const duration = $dt('transition.duration');
|
|
423
|
+
/*
|
|
424
|
+
duration: {
|
|
425
|
+
name: '--transition-duration',
|
|
426
|
+
variable: 'var(--p-transition-duration)',
|
|
427
|
+
value: '0.2s'
|
|
428
|
+
}
|
|
429
|
+
*/
|
|
430
|
+
|
|
431
|
+
const primaryColor = $dt('primary.color');
|
|
432
|
+
/*
|
|
433
|
+
primaryColor: {
|
|
434
|
+
name: '--primary-color',
|
|
435
|
+
variable: 'var(--p-primary-color)',
|
|
436
|
+
value: {
|
|
437
|
+
light: {
|
|
438
|
+
value: '#10b981',
|
|
439
|
+
paths: {
|
|
440
|
+
name: 'semantic.primary.color',
|
|
441
|
+
binding: {
|
|
442
|
+
name: 'primitive.emerald.500'
|
|
443
|
+
}
|
|
444
|
+
}
|
|
445
|
+
},
|
|
446
|
+
dark: {
|
|
447
|
+
value: '#34d399',
|
|
448
|
+
paths: {
|
|
449
|
+
name: 'semantic.primary.color',
|
|
450
|
+
binding: {
|
|
451
|
+
name: 'primitive.emerald.400'
|
|
452
|
+
}
|
|
453
|
+
}
|
|
454
|
+
}
|
|
455
|
+
}
|
|
456
|
+
}
|
|
457
|
+
*/
|
|
458
|
+
```
|
|
459
|
+
|
|
460
|
+
## palette
|
|
461
|
+
|
|
462
|
+
Returns shades and tints of a given color from 50 to 950 as an object.
|
|
463
|
+
|
|
464
|
+
```vue
|
|
465
|
+
import { palette } from '@primeuix/themes';
|
|
466
|
+
|
|
467
|
+
// custom color
|
|
468
|
+
const values1 = palette('#10b981');
|
|
469
|
+
|
|
470
|
+
// copy an existing token set
|
|
471
|
+
const primaryColor = palette('{blue}');
|
|
472
|
+
```
|
|
473
|
+
|
|
474
|
+
## Specificity
|
|
475
|
+
|
|
476
|
+
The @layer is a standard CSS feature to define cascade layers for a customizable order of precedence. If you need to become more familiar with layers, visit the documentation at MDN to begin with. The cssLayer is disabled by default, when it is enabled at theme configuration, PrimeVue wraps the built-in style classes under the primevue cascade layer to make the library styles easy to override. CSS in your app without a layer has the highest CSS specificity, so you'll be able to override styles regardless of the location or how strong a class is written. Layers also make it easier to use CSS Modules, view the CSS Modules guide for examples.
|
|
477
|
+
|
|
478
|
+
## Reset
|
|
479
|
+
|
|
480
|
+
In case PrimeVue components have visual issues in your application, a Reset CSS may be the culprit. CSS layers would be an efficient solution that involves enabling the PrimeVue layer, wrapping the Reset CSS in another layer and defining the layer order. This way, your Reset CSS does not get in the way of PrimeVue components.
|
|
481
|
+
|
|
482
|
+
```vue
|
|
483
|
+
/* Order */
|
|
484
|
+
@layer reset, primevue;
|
|
485
|
+
|
|
486
|
+
/* Reset CSS */
|
|
487
|
+
@layer reset {
|
|
488
|
+
button,
|
|
489
|
+
input {
|
|
490
|
+
/* CSS to Reset */
|
|
491
|
+
}
|
|
492
|
+
}
|
|
493
|
+
```
|
|
494
|
+
|
|
495
|
+
## CSS Modules
|
|
496
|
+
|
|
497
|
+
CSS modules are supported by enabling the module property on a style element within your SFC. Use the $style keyword to apply classes to a PrimeVue component. It is recommend to enable cssLayer when using CSS modules so that the PrimeVue styles have low CSS specificity.
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
# Tailwind CSS
|
|
2
|
+
|
|
3
|
+
Integration between PrimeVue and Tailwind CSS both in styled and unstyled modes.
|
|
4
|
+
|
|
5
|
+
## Overview
|
|
6
|
+
|
|
7
|
+
Tailwind CSS is a popular CSS framework based on a utility-first design. The core provides flexible CSS classes with predefined CSS rules to build your own UI elements. For example, instead of an opinionated btn class as in Bootstrap, Tailwind offers primitive classes like bg-blue-500 , rounded and p-4 to apply a button. Tailwind is an outstanding CSS library, however it lacks a true comprehensive UI suite when combined with Vue.js, this is where PrimeVue comes in by providing a wide range of highly accessible and feature rich UI component library. The core of PrimeVue does not depend on Tailwind CSS, instead we provide the necessary integration points such as the primeui tailwind plugin or a spin-off UI library called Volt based on unstyled PrimeVue. Tailwind CSS and PrimeVue can be used together via two main approaches to choose from. First approach is using Tailwind CSS around the styled PrimeVue components as demonstrated in the samples section below. The second alternative approach takes the integration a step further by replacing the default design token based styled mode with the unstyled mode and utilizing Tailwind CSS within the component internals via pass-through feature.
|
|
8
|
+
|
|
9
|
+
## Plugin
|
|
10
|
+
|
|
11
|
+
The tailwindcss-primeui is an official plugin by PrimeTek to provide first class integration between a Prime UI library like PrimeVue and Tailwind CSS. It is designed to work both in styled and unstyled modes. In styled mode, for instance the semantic colors such as primary and surfaces are provided as Tailwind utilities e.g. bg-primary , text-surface-500 , text-muted-color . If you haven't already done so, start by integrating Tailwind into your project. Detailed steps for this process can be found in the Tailwind documentation . After successfully installing Tailwind, proceed with the installation of the PrimeUI plugin. This single npm package comes with two libraries: the CSS version is compatible with Tailwind v4, while the JS version is designed for Tailwind v3. Tailwind v4 In the CSS file that contains the tailwindcss import, add the tailwindcss-primeui import as well. Tailwind v3 Use the plugins option in your Tailwind config file to configure the plugin.
|
|
12
|
+
|
|
13
|
+
## Extensions
|
|
14
|
+
|
|
15
|
+
The plugin extends the default configuration with a new set of utilities whose values are derived from the PrimeVue theme in use. All variants and breakpoints are supported e.g. dark:sm:hover:bg-primary . Color Palette Class Property primary-[50-950] Primary color palette. surface-[0-950] Surface color palette. primary Default primary color. primary-contrast Default primary contrast color. primary-emphasis Default primary emphasis color. border-surface Content border color. bg-emphasis Emphasis background e.g. hovered element. bg-highlight Highlight background. bg-highlight-emphasis Highlight background with emphasis. rounded-border Border radius. text-color Text color with emphasis. text-color-emphasis Default primary emphasis color. text-muted-color Secondary text color. text-muted-color-emphasis Secondary text color with emphasis.
|
|
16
|
+
|
|
17
|
+
## Dark Mode
|
|
18
|
+
|
|
19
|
+
In styled mode, PrimeVue uses the system as the default darkModeSelector in theme configuration. If you have a dark mode switch in your application, ensure that darkModeSelector is aligned with the Tailwind dark variant for seamless integration. Note that, this particular configuration isn't required if you're utilizing the default system color scheme. Suppose that, the darkModeSelector is set as my-app-dark in PrimeVue. Tailwind v4 Add a custom variant for dark with a custom selector. Tailwind v3 Use the plugins option in your Tailwind config file to configure the plugin.
|
|
20
|
+
|
|
21
|
+
## Override
|
|
22
|
+
|
|
23
|
+
Tailwind utilities may not be able to override the default styling of components due to css specificity, there are two possible solutions; Important and CSS Layer. Important Use the ! as a prefix to enforce the styling. This is not the recommend approach, and should be used as last resort to avoid adding unnecessary style classes to your bundle. Tailwind v4 Tailwind v3 CSS Layer CSS Layer provides control over the css specificity so that Tailwind utilities can safely override components. Tailwind v4 Ensure primevue layer is after theme and base , but before the other Tailwind layers such as utilities . No change in the CSS configuration is required. Tailwind v3 The primevue layer should be between base and utilities. Tailwind v3 does not use native layer so needs to be defined with CSS.
|
|
24
|
+
|
|
25
|
+
## Color Palette
|
|
26
|
+
|
|
27
|
+
PrimeVue color palette as utility classes.
|
|
28
|
+
|
|
29
|
+
```vue
|
|
30
|
+
<div class="flex flex-col gap-12">
|
|
31
|
+
<div class="flex gap-6 flex-wrap">
|
|
32
|
+
<div class="rounded-border p-4 border border-transparent flex items-center justify-center bg-primary hover:bg-primary-emphasis text-primary-contrast font-medium flex-auto transition-colors">primary</div>
|
|
33
|
+
<div class="rounded-border p-4 border border-transparent flex items-center justify-center bg-highlight hover:bg-highlight-emphasis font-medium flex-auto transition-colors">highlight</div>
|
|
34
|
+
<div class="rounded-border p-4 border border-surface flex items-center justify-center text-muted-color hover:text-color hover:bg-emphasis font-medium flex-auto transition-colors">box</div>
|
|
35
|
+
</div>
|
|
36
|
+
</div>
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## Form
|
|
40
|
+
|
|
41
|
+
Using Tailwind utilities for the responsive layout of a form with PrimeVue components.
|
|
42
|
+
|
|
43
|
+
```vue
|
|
44
|
+
<template>
|
|
45
|
+
<div class="flex flex-col gap-6 w-full sm:w-auto">
|
|
46
|
+
<div class="flex flex-col sm:flex-row sm:items-center gap-6">
|
|
47
|
+
<div class="flex-auto">
|
|
48
|
+
<label for="firstname" class="block font-semibold mb-2">Firstname</label>
|
|
49
|
+
<InputText id="firstname" class="w-full" />
|
|
50
|
+
</div>
|
|
51
|
+
<div class="flex-auto">
|
|
52
|
+
<label for="lastname" class="block font-semibold mb-2">Lastname</label>
|
|
53
|
+
<InputText id="lastname" class="w-full" />
|
|
54
|
+
</div>
|
|
55
|
+
</div>
|
|
56
|
+
<div class="flex flex-col sm:flex-row sm:items-center gap-6">
|
|
57
|
+
<div class="flex-1">
|
|
58
|
+
<label for="date" class="block font-semibold mb-2">Date</label>
|
|
59
|
+
<DatePicker inputId="date" class="w-full" />
|
|
60
|
+
</div>
|
|
61
|
+
<div class="flex-1">
|
|
62
|
+
<label for="country" class="block font-semibold mb-2">Country</label>
|
|
63
|
+
<Select v-model="selectedCountry" inputId="country" :options="countries" optionLabel="name" placeholder="Select a Country" class="w-full">
|
|
64
|
+
<template #value="slotProps">
|
|
65
|
+
<div v-if="slotProps.value" class="flex items-center">
|
|
66
|
+
<img :alt="slotProps.value.label" src="https://primefaces.org/cdn/primevue/images/flag/flag_placeholder.png" :class="\`mr-2 flag flag-\${slotProps.value.code.toLowerCase()}\`" style="width: 18px" />
|
|
67
|
+
<div>{{ slotProps.value.name }}</div>
|
|
68
|
+
</div>
|
|
69
|
+
<span v-else>
|
|
70
|
+
{{ slotProps.placeholder }}
|
|
71
|
+
</span>
|
|
72
|
+
</template>
|
|
73
|
+
<template #option="slotProps">
|
|
74
|
+
<div class="flex items-center">
|
|
75
|
+
<img :alt="slotProps.option.label" src="https://primefaces.org/cdn/primevue/images/flag/flag_placeholder.png" :class="\`mr-2 flag flag-\${slotProps.option.code.toLowerCase()}\`" style="width: 18px" />
|
|
76
|
+
<div>{{ slotProps.option.name }}</div>
|
|
77
|
+
</div>
|
|
78
|
+
</template>
|
|
79
|
+
</Select>
|
|
80
|
+
</div>
|
|
81
|
+
</div>
|
|
82
|
+
<div class="flex-auto">
|
|
83
|
+
<label for="message" class="block font-semibold mb-2">Message</label>
|
|
84
|
+
<Textarea id="message" class="w-full" rows="4" />
|
|
85
|
+
</div>
|
|
86
|
+
</div>
|
|
87
|
+
</template>
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
## Headless
|
|
91
|
+
|
|
92
|
+
A headless PrimeVue dialog with a custom UI.
|
|
93
|
+
|
|
94
|
+
```vue
|
|
95
|
+
<template>
|
|
96
|
+
<Button @click="visible = true">
|
|
97
|
+
<User />
|
|
98
|
+
Login
|
|
99
|
+
</Button>
|
|
100
|
+
|
|
101
|
+
<Dialog v-model:visible="visible" pt:root:class="border-0! bg-transparent!" pt:mask:class="backdrop-blur-xs">
|
|
102
|
+
<template #container="{ closeCallback }">
|
|
103
|
+
<div class="flex flex-col px-8 py-8 gap-6 rounded-2xl" style="background-image: radial-gradient(circle at left top, var(--p-primary-400), var(--p-primary-700))">
|
|
104
|
+
<svg width="35" height="40" viewBox="0 0 35 40" fill="none" xmlns="http://www.w3.org/2000/svg" class="block mx-auto">
|
|
105
|
+
<path
|
|
106
|
+
d="M25.87 18.05L23.16 17.45L25.27 20.46V29.78L32.49 23.76V13.53L29.18 14.73L25.87 18.04V18.05ZM25.27 35.49L29.18 31.58V27.67L25.27 30.98V35.49ZM20.16 17.14H20.03H20.17H20.16ZM30.1 5.19L34.89 4.81L33.08 12.33L24.1 15.67L30.08 5.2L30.1 5.19ZM5.72 14.74L2.41 13.54V23.77L9.63 29.79V20.47L11.74 17.46L9.03 18.06L5.72 14.75V14.74ZM9.63 30.98L5.72 27.67V31.58L9.63 35.49V30.98ZM4.8 5.2L10.78 15.67L1.81 12.33L0 4.81L4.79 5.19L4.8 5.2ZM24.37 21.05V34.59L22.56 37.29L20.46 39.4H14.44L12.34 37.29L10.53 34.59V21.05L12.42 18.23L17.45 26.8L22.48 18.23L24.37 21.05ZM22.85 0L22.57 0.69L17.45 13.08L12.33 0.69L12.05 0H22.85Z"
|
|
107
|
+
fill="var(--p-primary-700)"
|
|
108
|
+
/>
|
|
109
|
+
<path
|
|
110
|
+
d="M30.69 4.21L24.37 4.81L22.57 0.69L22.86 0H26.48L30.69 4.21ZM23.75 5.67L22.66 3.08L18.05 14.24V17.14H19.7H20.03H20.16H20.2L24.1 15.7L30.11 5.19L23.75 5.67ZM4.21002 4.21L10.53 4.81L12.33 0.69L12.05 0H8.43002L4.22002 4.21H4.21002ZM21.9 17.4L20.6 18.2H14.3L13 17.4L12.4 18.2L12.42 18.23L17.45 26.8L22.48 18.23L22.5 18.2L21.9 17.4ZM4.79002 5.19L10.8 15.7L14.7 17.14H14.74H15.2H16.85V14.24L12.24 3.09L11.15 5.68L4.79002 5.2V5.19Z"
|
|
111
|
+
fill="var(--p-primary-200)"
|
|
112
|
+
/>
|
|
113
|
+
</svg>
|
|
114
|
+
<div class="inline-flex flex-col gap-2">
|
|
115
|
+
<label for="username" class="text-primary-50 font-semibold">Username</label>
|
|
116
|
+
<InputText id="username" class="bg-white/20! border-0! p-4! text-primary-50! w-80"></InputText>
|
|
117
|
+
</div>
|
|
118
|
+
<div class="inline-flex flex-col gap-2">
|
|
119
|
+
<label for="password" class="text-primary-50 font-semibold">Password</label>
|
|
120
|
+
<InputText id="password" class="bg-white/20! border-0! p-4! text-primary-50! w-80" type="password"></InputText>
|
|
121
|
+
</div>
|
|
122
|
+
<div class="flex items-center gap-4">
|
|
123
|
+
<Button @click="closeCallback" text class="p-4! w-full text-primary-50! border! border-white/30! hover:bg-white/10!">Cancel</Button>
|
|
124
|
+
<Button @click="closeCallback" text class="p-4! w-full text-primary-50! border! border-white/30! hover:bg-white/10!">Sign-In</Button>
|
|
125
|
+
</div>
|
|
126
|
+
</div>
|
|
127
|
+
</template>
|
|
128
|
+
</Dialog>
|
|
129
|
+
</template>
|
|
130
|
+
|
|
131
|
+
<script setup>
|
|
132
|
+
import User from '@primeicons/vue/user';
|
|
133
|
+
<\/script>
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
## Starter
|
|
137
|
+
|
|
138
|
+
The Tailwind v4 and PrimeVue starter example is available to demonstrate the integration setup with an example dashboard.
|
|
139
|
+
|
|
140
|
+
## Animations
|
|
141
|
+
|
|
142
|
+
The plugin also adds extended animation utilities that can be used with the styleclass and animateonscroll directives. Enter and Leave In addition to the prebuilt animations, you may also build your own declaratively using the animate-enter and animate-leave along with the opacity, rotate, scale and translate parameters. These animations work perfectly with the AnimateOnScroll directive, visit this directive for various examples. Learn More Animations Class Property animate-enter animation-name: enter; --p-enter-opacity: initial; --p-enter-scale: initial; --p-enter-rotate: initial; --p-enter-translate-x: initial; --p-enter-translate-y: initial; animate-leave animation-name: leave; --p-leave-opacity: initial; --p-leave-scale: initial; --p-leave-rotate: initial; --p-leave-translate-x: initial; --p-leave-translate-y: initial; animate-fadein fadein 0.15s linear animate-fadeout fadeout 0.15s linear animate-slidedown slidedown 0.45s ease-in-out animate-slideup slideup 0.45s cubic-bezier(0, 1, 0, 1) animate-scalein scalein 0.15s linear animate-fadeinleft fadeinleft 0.15s linear animate-fadeoutleft fadeoutleft 0.15s linear animate-fadeinright fadeinright 0.15s linear animate-fadeoutright fadeoutright 0.15s linear animate-fadeinup fadeinup 0.15s linear animate-fadeoutup fadeoutup 0.15s linear animate-fadeindown fadeindown 0.15s linear animate-fadeoutup fadeoutup 0.15s linear animate-width width 0.15s linear animate-flip flip 0.15s linear animate-flipup flipup 0.15s linear animate-flipleft fadein 0.15s linear animate-flipright flipright 0.15s linear animate-zoomin zoomin 0.15s linear animate-zoomindown zoomindown 0.15s linear animate-zoominleft zoominleft 0.15s linear animate-zoominright zoominright 0.15s linear animate-zoominup zoominup 0.15s linear Animation Duration Class Property animate-duration-0 animation-duration: 0s animate-duration-75 animation-duration: 75ms animate-duration-100 animation-duration: 100ms animate-duration-200 animation-duration: 200ms animate-duration-300 animation-duration: 300ms animate-duration-400 animation-duration: 400ms animate-duration-500 animation-duration: 500ms animate-duration-700 animation-duration: 700ms animate-duration-1000 animation-duration: 1000ms animate-duration-2000 animation-duration: 2000ms animate-duration-3000 animation-duration: 300ms animate-duration-[value] animation-duration: value Animation Delay Class Property animate-delay-none animation-duration: 0s animate-delay-75 animation-delay: 75ms animate-delay-100 animation-delay: 100ms animate-delay-150 animation-delay: 150ms animate-delay-200 animation-delay: 200ms animate-delay-300 animation-delay: 300ms animate-delay-400 animation-delay: 400ms animate-delay-500 animation-delay: 500ms animate-delay-700 animation-delay: 700ms animate-delay-1000 animation-delay: 1000ms Iteration Count Class Property animate-infinite animation-iteration-count: infinite animate-once animation-iteration-count: 1 animate-twice animation-iteration-count: 2 Direction Class Property animate-normal animation-direction: normal animate-reverse animation-direction: reverse animate-alternate animation-direction: alternate animate-alternate-reverse animation-direction: alternate-reverse Timing Function Class Property animate-ease-linear animation-timing-function: linear animate-ease-in animation-timing-function: cubic-bezier(0.4, 0, 1, 1) animate-ease-out animation-timing-function: cubic-bezier(0, 0, 0.2, 1) animate-ease-in-out animation-timing-function: cubic-bezier(0.4, 0, 0.2, 1) Fill Mode Class Property animate-fill-none animation-fill-mode: normal animate-fill-forwards animation-fill-mode: forwards animate-fill-backwards animation-fill-mode: backwards animate-fill-both animation-fill-mode: both Play State Class Property animate-running animation-play-state: running animate-paused animation-play-state: paused Backface Visibility State Class Property backface-visible backface-visibility: visible backface-hidden backface-visibility: hidden Fade In and Out Values are derived from the Tailwind CSS opacity e.g. fade-in-50 and fade-out-20 . Arbitrary values such as fade-in-[15] are also supported. Class Property fade-in-{value} --p-enter-opacity: {value} fade-out-{value} --p-leave-opacity: {value} Zoom In and Out Values are derived from the Tailwind CSS scale e.g. zoom-in-50 and zoom-out-75 . Arbitrary values such as zoom-in-[0.8] are also supported. Class Property zoom-in-{value} --p-enter-scale: {value} zoom-out-{value} --p-leave-scale: {value} Spin In and Out Values are derived from the Tailwind CSS rotate e.g. spin-in-45 and spin-out-90 . Arbitrary values such as spin-in-[60deg] are also supported. Class Property spin-in-{value} --p-enter-rotate: {value} spin-out-{value} --p-leave-rotate: {value} Slide In and Out Values are derived from the Tailwind CSS translate e.g. slide-in-from-t-50 and slide-out-to-l-8 . Arbitrary values such as slide-in-from-b-[8px] are also supported. Class Property slide-in-from-t-{value} --p-enter-translate-y: -{value} slide-in-from-b-{value} --p-enter-translate-y: {value} slide-in-from-l-{value} --p-enter-translate-x: -{value} slide-in-from-r-{value} --p-enter-translate-x: {value} slide-out-to-t-{value} --p-leave-translate-y: -{value} slide-out-to-b-{value} --p-leave-translate-y: {value} slide-out-to-l-{value} --p-leave-translate-x: -{value} slide-out-to-r-{value} --p-leave-translate-x: {value}
|
|
143
|
+
|
|
144
|
+
```vue
|
|
145
|
+
<template>
|
|
146
|
+
<Select v-model="animation" :options="animations" placeholder="Select One" class="w-full sm:w-44" />
|
|
147
|
+
<div class="py-8 overflow-hidden">
|
|
148
|
+
<div :class="\`rounded-border bg-primary w-16 h-16 mx-auto animate-\${animation} animate-once animate-duration-1000\`"></div>
|
|
149
|
+
</div>
|
|
150
|
+
</template>
|
|
151
|
+
```
|