X Enterprises
nuxt-x-auth-local

Form

Shared Zod-validated form shell used internally by all nuxt-x-auth-local page components.

Form

The XAuthForm component is the low-level form shell shared by all auth page components in this layer (XAuthLogin, XAuthSignup, XAuthForgotPassword, and the reset-password page). It renders the centered icon/title/description header, a Zod-validated UForm generated from a fields array (with password visibility toggles), and a block submit button.

Components

<XAuthForm />

Use XAuthForm to build a custom auth form that matches the standard auth UI.

<script setup>
import { z } from 'zod'

const fields = [
  { name: 'email', type: 'email', label: 'Email', placeholder: 'you@example.com', required: true },
]
const schema = z.object({ email: z.string().email() })
</script>

<template>
  <XAuthForm
    title="Reset Password"
    description="Enter your new password below"
    icon="i-lucide-key-round"
    :fields="fields"
    :schema="schema"
    :submit="{ label: 'Continue' }"
    @submit="onSubmit"
  />
</template>

Props

PropTypeDefaultDescription
iconstringundefinedIconify icon shown in a circle above the title (e.g. i-lucide-log-in)
titlestringundefinedHeading displayed above the form
descriptionstringundefinedSubheading below the title (overridden by the description slot)
fieldsarray[]Field descriptors: { name, type: 'email' | 'text' | 'password', label, placeholder, required }
schemaobjectundefinedZod schema passed to UForm for validation
submitobject{ label: 'Continue' }Submit button options (label)
loadingbooleanfalseDisables inputs and shows a loading state on the submit button

Emits

EventPayloadDescription
submitFormSubmitEventEmitted by UForm on valid submit; read values from event.data

Slots

SlotDescription
descriptionReplaces the description prop below the title (used for "Sign up" / "Sign in" links)
password-hintHint rendered on password fields (used for the "Forgot password?" link)
footerContent rendered below the submit button

AI Context

component: XAuthForm
package: "@xenterprises/nuxt-x-auth-local"
use-when: Building a custom auth form for a local JWT backend that needs the shared fields-driven, Zod-validated form shell
Copyright © 2026