You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This guide explains how to use [vue-i18n](https://vue-i18n.intlify.dev/) for internationalization in your FormKit PrimeVue project.
4
+
## Installation
5
+
6
+
If you are using Nuxt, the i18n module can be installed automatically by the [FormKit PrimeVue Nuxt module](nuxt.md). For manual installation in a Vue project:
7
+
8
+
```bash
9
+
npm install vue-i18n
10
+
```
11
+
12
+
## Nuxt Integration
13
+
14
+
If you use the Nuxt module, i18n is auto-installed and configured. You can add your translations in the `/locales` directory.
15
+
16
+
::: info
17
+
**Note:** Internationalization (i18n) is only required for Output components in FormKit PrimeVue. Input components do not require i18n integration.
This section covers advanced usage and features of the FormKit PrimeVue integration. Explore the following topics for deeper insights and customization options:
4
4
5
-
Composables are used make your development with this library a little easier.
6
-
Schema- and Repeater-related composables are provided to simplify the usage of the library.
5
+
## Available Topics
7
6
8
-
## Nuxt
9
-
10
-
Nuxt Module is available.
7
+
-[Composables](composables.md): Utility functions and helpers to simplify schema and repeater usage in your forms.
8
+
-[Nuxt](nuxt.md): Guide to using the Nuxt module for seamless integration with Nuxt projects.
9
+
-[Plugins](plugins.md): Extend and enhance functionality with available plugins.
10
+
-[Schema](schema.md): Advanced schema usage, tips, and best practices for dynamic and complex forms.
11
+
-[I18n](i18n.md): Internationalization support for Output components.
Copy file name to clipboardExpand all lines: docs/guide/styling.md
+145Lines changed: 145 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -55,3 +55,148 @@ const formkitItems = [
55
55
- Some Components have addtional properties for the rendered inputs (eg: optionClass, labelClass in primeRadioButton)
56
56
- PT and PTOptions are available ([https://primevue.org/passthrough/](https://primevue.org/passthrough/))
57
57
-[Styling](https://formkit-primevue.netlify.app/demo/styling), [Grid](https://formkit-primevue.netlify.app/demo/grid) and [PT](https://formkit-primevue.netlify.app/demo/passThrough) demo available
58
+
59
+
## Advanced Styling Examples
60
+
61
+
### Styling by Class and Style Attribute
62
+
63
+
You can apply custom classes or direct style attributes to your FormKit PrimeVue components:
64
+
65
+
```js
66
+
constschema= [
67
+
{
68
+
$formkit:'primeInputText',
69
+
name:'name',
70
+
label:'Styling by class',
71
+
class:'stylingSampleClass',
72
+
},
73
+
{
74
+
$formkit:'primeInputText',
75
+
name:'name2',
76
+
label:'Styling by style attribute',
77
+
style: { color:'gray', fontWeight:700 },
78
+
},
79
+
]
80
+
```
81
+
82
+
```scss
83
+
.p-formkit {
84
+
.stylingSampleClass {
85
+
color: green;
86
+
}
87
+
}
88
+
```
89
+
90
+
This allows you to use either a CSS class or inline styles for flexible customization.
91
+
92
+
---
93
+
94
+
### Using outerClass and innerClass
95
+
96
+
You can target the outer or inner wrapper of a component for more granular styling:
97
+
98
+
```js
99
+
constschema= [
100
+
{
101
+
$formkit:'primeInputText',
102
+
name:'name',
103
+
label:'Styling outer class',
104
+
outerClass:'stylingOuterClass',
105
+
},
106
+
{
107
+
$formkit:'primeInputText',
108
+
name:'name2',
109
+
label:'Styling inner class',
110
+
innerClass:'stylingSampleClass',
111
+
},
112
+
]
113
+
```
114
+
115
+
```scss
116
+
.stylingOuterClass {
117
+
color: yellowgreen;
118
+
}
119
+
.stylingSampleClassinput {
120
+
color: green;
121
+
}
122
+
```
123
+
124
+
---
125
+
126
+
### Grid Layout
127
+
128
+
Use the grid system by assigning `outerClass` values like `col-6`, `col-8`, etc., to arrange fields responsively:
129
+
130
+
```js
131
+
constschema= [
132
+
{
133
+
$formkit:'primeInputText',
134
+
name:'name',
135
+
label:'col-8',
136
+
outerClass:'col-8',
137
+
},
138
+
{
139
+
$formkit:'primeInputText',
140
+
name:'name2',
141
+
label:'col-4',
142
+
outerClass:'col-4',
143
+
},
144
+
]
145
+
```
146
+
147
+
---
148
+
149
+
### Horizontal Forms
150
+
151
+
Combine grid classes and custom layout for horizontal forms:
152
+
153
+
```js
154
+
constschema= [
155
+
{
156
+
$formkit:'primeInputText',
157
+
name:'email',
158
+
label:'Email',
159
+
outerClass:'col-6',
160
+
},
161
+
{
162
+
$formkit:'primePassword',
163
+
name:'password',
164
+
label:'Password',
165
+
outerClass:'col-5',
166
+
},
167
+
// ...
168
+
]
169
+
```
170
+
171
+
---
172
+
173
+
### PassThrough Styling
174
+
175
+
You can use the `pt` property to pass styles or classes directly to PrimeVue components:
176
+
177
+
```js
178
+
constpt_content= {
179
+
root: { style:'font-weight: 600;color: green;' },
180
+
}
181
+
constpt_content_style_class= {
182
+
root: { class:'!text-red-500' },
183
+
}
184
+
constschema= [
185
+
{
186
+
$formkit:'primeInputText',
187
+
name:'name',
188
+
label:'PassThrough with style',
189
+
pt: pt_content,
190
+
},
191
+
{
192
+
$formkit:'primeInputText',
193
+
name:'name2',
194
+
label:'PassThrough with tailwind like style class',
195
+
pt: pt_content_style_class,
196
+
},
197
+
]
198
+
```
199
+
200
+
---
201
+
202
+
These examples demonstrate the flexibility of FormKit PrimeVue components for advanced styling, including class-based, inline, grid, horizontal, and pass-through customizations.
Copy file name to clipboardExpand all lines: docs/index.md
+2-1Lines changed: 2 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -20,4 +20,5 @@ features:
20
20
details: Next Generation Vue UI Component Library. Rich set of open source native components for Vue.
21
21
- title: "FormKit"
22
22
details: A Vue form building framework that simplifies form structure, generation, validation, theming, submission, error handling, and more.
23
-
---
23
+
- title: "Components"
24
+
details: This project currently provides 18 input components and 7 output components, making it easy to build and display forms with PrimeVue and FormKit.
0 commit comments