Forms Technical Details

This document provides technical details about the Forms feature, primarily for developers or for advanced configuration after deployment.

Configuration

The forms module is configured in nuxt.config.ts. It includes settings for spam protection, rate limiting, and analytics.

Example configuration:

export default defineNuxtConfig({
  formModule: {
    enableNotifications: true,
    enableAnalytics: true,
    turnstile: {
      enabled: true,
      siteKey: process.env.NUXT_PUBLIC_TURNSTILE_SITE_KEY,
    },
    spam: {
      enabled: true,
      honeypotFields: ['_honeypot', 'website'],
      blockPatterns: ['viagra', 'cialis'],
    },
    rateLimit: {
      enabled: true,
      maxSubmissions: 5,
      windowMinutes: 60,
    },
  },
})

Creating Forms

Forms are created using the Form component and useForm composable.

Example usage:

<template>
  <Form @submit="handleSubmit">
    <UInput v-model="state.name" label="Name" />
    <UInput v-model="state.email" label="Email" type="email" />
    <UTextarea v-model="state.message" label="Message" />
    <UButton type="submit" :loading="loading">Submit</UButton>
  </Form>
</template>

<script setup>
import { useForm } from '#form'

const { state, loading, handleSubmit } = useForm({
  formId: 'contact',
  initialState: {
    name: '',
    email: '',
    message: '',
  },
})
</script>

Admin Capabilities

The module exposes admin configuration via useFormsAdmin, providing interfaces for:

  • Form Builder (drag-and-drop interface)
  • Submission management and export
  • Analytics dashboards

Need a Landing Page?

Modern landing pages with optional modules (blog, docs, forms, i18n). Let's discuss your project.

Build Your MVP

Full-stack SaaS development. Expert in database design, multi-tenancy, and scalable architecture.

Deployment Help

Dockerize your backend, set up CI/CD pipelines, deploy to Cloudflare or Hetzner. Early-stage setup.

Suggest a SaaS Tool

Missing a calculator or tool? Suggest what you'd like to see on our site.