Skip to content

Form Components

Form components handle input fields, validation, and submission. All input components integrate with vee-validate and must be used inside VqForm or useVqForm.


Available Components

ComponentDescriptionLink
VqFormCore form wrapper — handles validation, API submission, busy state, and server error mapping→ Docs
useVqFormComposable version of VqForm with direct access to resetForm→ Docs
VqTextFieldValidated single-line text input→ Docs
VqTextareaValidated multi-line text area→ Docs
VqCheckboxValidated checkbox storing a boolean value→ Docs
VqAutocompleteValidated autocomplete/select with optional API item loading→ Docs
VqDatePickerValidated date picker (dialog or menu mode)→ Docs
VqTimePickerValidated time picker (dialog or menu mode)→ Docs
VqColorPickerValidated color picker (dialog or menu mode)→ Docs
VqOtpInputValidated OTP (one-time password) input→ Docs
VqFileInputValidated single-file selection input→ Docs
VqFileUploadValidated file upload input (Vuetify Labs)→ Docs
VqSubmitBtnSubmit button with automatic loading/disabled state→ Docs

How It Works

  1. Wrap your form with VqForm (or useVqForm)
  2. Place input components inside — they bind to the form automatically via vee-validate
  3. Add VqSubmitBtn — it disables and shows a spinner during submission
  4. On submit, VqForm validates all fields, sends the request, and maps server errors back to fields
vue
<script setup>
import { VqForm, VqTextField, VqAutocomplete, VqSubmitBtn } from "@qnx/vuetify";
import { object, string } from "yup";

const schema = object({
  name: string().required("Name is required"),
  email: string().required().email("Invalid email"),
  role: string().required("Please select a role"),
});
</script>

<template>
  <VqForm
    id="create-user"
    action="users/create"
    method="POST"
    :validation-schema="schema"
    @submited-success="(res) => console.log('Created:', res)"
  >
    <VqTextField name="name" label="Full Name" />
    <VqTextField name="email" label="Email" type="email" />
    <VqAutocomplete name="role" label="Role" :items="['Admin', 'Editor', 'Viewer']" />
    <VqSubmitBtn>Create User</VqSubmitBtn>
  </VqForm>
</template>

Import

All form components are available from the main package:

typescript
import {
  VqForm,
  useVqForm,
  VqTextField,
  VqTextarea,
  VqCheckbox,
  VqAutocomplete,
  VqDatePicker,
  VqTimePicker,
  VqColorPicker,
  VqOtpInput,
  VqFileInput,
  VqFileUpload,
  VqSubmitBtn,
} from "@qnx/vuetify";