@quickflo/quickforms-vue
@quickforms/vue
Vue 3 bindings for QuickForms - JSON Schema form generator.
Features
- DynamicForm - Main form component with VeeValidate integration
- Field Components - Pre-built components for basic types (string, number, boolean, enum, date)
- FieldRenderer - Automatic component selection based on schema
- VeeValidate Integration - Form validation and state management
- TypeScript - Full type safety
Installation
pnpm add @quickforms/vue vue vee-validate
Quick Start
<script setup lang="ts">
import { ref } from 'vue';
import { DynamicForm, type JSONSchema } from '@quickforms/vue';
const schema: JSONSchema = {
type: 'object',
properties: {
name: {
type: 'string',
title: 'Full Name',
minLength: 2
},
email: {
type: 'string',
format: 'email',
title: 'Email'
},
age: {
type: 'number',
title: 'Age',
minimum: 0
}
},
required: ['name', 'email']
};
const formData = ref({});
const handleSubmit = (data: any) => {
console.log('Form submitted:', data);
};
</script>
<template>
<DynamicForm
:schema="schema"
v-model="formData"
@submit="handleSubmit"
/>
</template>
Components
DynamicForm
Main form component that generates form fields from JSON Schema.
Props:
schema: JSONSchema- JSON Schema definitionmodelValue?: Record<string, any>- Form data (v-model)options?: FormOptions- Form configuration
Events:
@update:modelValue- Emitted when form data changes@submit- Emitted when form is submitted with valid data
Slots:
actions- Custom submit button area
Field Components
Pre-built field components:
StringField- Text inputs, email, url, textareaNumberField- Number inputs with min/max/stepBooleanField- CheckboxEnumField- Select dropdownDateField- Date, time, datetime inputs
Each field supports:
- Validation via VeeValidate
- Error messages
- Required field indicators
- Disabled/readonly states
- Accessibility (ARIA labels)
Composables
useFormField
Hook for individual field state management.
const { value, errorMessage, label, hint } = useFormField(path, schema);
useFormContext
Access form-level context.
const context = useFormContext();
// { readonly, disabled, schema, rootPath }
Customization
Custom Submit Button
<template>
<DynamicForm :schema="schema" v-model="formData" @submit="handleSubmit">
<template #actions="{ isValid, errors }">
<button type="submit" :disabled="!isValid">
Save Form
</button>
<button type="button" @click="cancel">
Cancel
</button>
</template>
</DynamicForm>
</template>
Form Options
<template>
<DynamicForm
:schema="schema"
v-model="formData"
:options="{
readonly: false,
disabled: false
}"
/>
</template>
Styling
All components use scoped styles with CSS classes prefixed with quickform-. You can override styles globally or use custom field components.
License
MIT
Related Packages
@formkit/observer
Utility to wrap a FormKitNode in a dependency tracking observer proxy
5,049,667
4,779
Version History
| Version | Released | Vue | License |
|---|---|---|---|
| 1.29.0 | ^3.3.0 | MIT | |
| 1.28.10 | ^3.3.0 | MIT | |
| 1.28.9 | ^3.3.0 | MIT | |
| 1.28.8 | ^3.3.0 | MIT | |
| 1.28.7 | ^3.3.0 | MIT | |
| 1.28.6 | ^3.3.0 | MIT | |
| 1.28.5 | ^3.3.0 | MIT | |
| 1.28.4 | ^3.3.0 | MIT | |
| 1.28.3 | ^3.3.0 | MIT | |
| 1.28.2 | ^3.3.0 | MIT | |
| 1.28.1 | ^3.3.0 | MIT | |
| 1.28.0 | ^3.3.0 | MIT | |
| 1.27.2 | ^3.3.0 | MIT | |
| 1.26.0 | ^3.3.0 | MIT | |
| 1.25.0 | ^3.3.0 | MIT | |
| 1.24.0 | ^3.3.0 | MIT | |
| 1.23.0 | ^3.3.0 | MIT | |
| 1.22.0 | ^3.3.0 | MIT | |
| 1.21.0 | ^3.3.0 | MIT | |
| 1.20.0 | ^3.3.0 | MIT | |
| 1.19.50 | ^3.3.0 | MIT | |
| 1.19.49 | ^3.3.0 | MIT | |
| 1.19.48 | ^3.3.0 | MIT | |
| 1.19.47 | ^3.3.0 | MIT | |
| 1.19.46 | ^3.3.0 | MIT | |
| 1.19.45 | ^3.3.0 | MIT | |
| 1.19.44 | ^3.3.0 | MIT | |
| 1.19.43 | ^3.3.0 | MIT | |
| 1.19.42 | ^3.3.0 | MIT | |
| 1.19.41 | ^3.3.0 | MIT |
Showing the latest 30 of 158. See every release on npm