Claude Code Plugins

Community-maintained marketplace

Feedback

Form handling with XForm component and useFormBuilder. Use when creating forms, handling validation errors, managing form state, or building form-based slideovers and modals.

Install Skill

1Download skill
2Enable skills in Claude

Open claude.ai/settings/capabilities and find the "Skills" section

3Upload to Claude

Click "Upload skill" and select the downloaded ZIP file

Note: Please verify skill by going through its instructions before using it.

SKILL.md

name nuxt-forms
description Form handling with XForm component and useFormBuilder. Use when creating forms, handling validation errors, managing form state, or building form-based slideovers and modals.

Nuxt Forms

Form handling with XForm component and validation error display.

Core Concepts

forms.md - XForm, useFormBuilder, validation patterns

XForm Component

<XForm
  ref="formRef"
  url="/api/posts"
  method="POST"
  :data="formData"
  :waiting="waitingFor.posts.creating"
  @submit="onSubmit"
  @success="onSuccess"
  @error="onError"
>
  <UFormField label="Title" name="title" :error="form?.errors.first('title')">
    <UInput v-model="formData.title" />
  </UFormField>

  <template #actions>
    <UButton type="submit" label="Create" :loading="form?.processing" />
  </template>
</XForm>

Form Data Pattern

const formData = ref<CreatePostData>({
  title: '',
  content: '',
  authorId: '',
  isDraft: true,
})

const onSubmit = async (data: CreatePostData) => {
  await createPostAction(data)
}

const onSuccess = () => {
  emits('close', true)
}

Validation Errors

// Access errors
form.errors.has('title')       // boolean
form.errors.first('title')     // string | undefined
form.errors.get('title')       // string[] | undefined
form.errors.any()              // boolean

// Display in template
<UFormField label="Title" name="title" :error="form?.errors.first('title')">