notform-nuxt is the official Nuxt module for NotForm.
It integrates the NotForm core package with Nuxt's auto-import system so the composable and components are available directly in your Nuxt application.
The module is available through the Nuxt Modules Registry:
npx nuxi module add notformOr install it directly:
pnpm add notform-nuxtAdd the module to nuxt.config.ts when installing manually:
export default defineNuxtConfig({
modules: ['notform-nuxt'],
})That's it. The NotForm composable and components are auto-imported in your Nuxt application.
You can use NotForm without importing the composable or components in your Vue files:
<script setup lang="ts">
import { z } from 'zod'
const schema = z.object({
email: z.email('Enter a valid email address'),
name: z.string('Enter a valid name'),
})
const form = useNotForm({
initialValues: {
email: '',
name: '',
},
onSubmit(values) {
console.log('Submitted:', values)
},
schema,
})
</script>
<template>
<NotForm
:form="form"
@submit="form.submit"
@reset="form.reset()"
>
<NotField
v-slot="{ events, path }"
path="name"
>
<div>
<label :for="path">Name</label>
<input
:id="path"
v-model="form.values.name"
v-bind="events"
name="name"
type="text"
autocomplete="name"
>
<NotMessage :path="path" />
</div>
</NotField>
<NotField
v-slot="{ events, path }"
path="email"
>
<div>
<label :for="path">Email address</label>
<input
:id="path"
v-model="form.values.email"
v-bind="events"
name="email"
type="email"
autocomplete="email"
>
<NotMessage :path="path" />
</div>
</NotField>
<button type="submit">
Submit
</button>
<button type="reset">
Reset
</button>
</NotForm>
</template>NotArrayField provides renderless operations for dynamic arrays while preserving stable item keys during reordering.
<script setup lang="ts">
import { z } from 'zod'
const tagSchema = z.string()
const schema = z.object({
tags: z.array(tagSchema).optional(),
})
const form = useNotForm({
initialValues: {
tags: [''],
},
onSubmit(values) {
console.log('Submitted:', values)
},
schema,
})
</script>
<template>
<NotForm
:form="form"
@submit="form.submit"
@reset="form.reset()"
>
<NotArrayField
v-slot="{ items, append, remove }"
path="tags"
:item-schema="tagSchema"
>
<div
v-for="(item, index) in items"
:key="item.key"
>
<NotField
v-slot="{ events, path }"
:path="item.path"
>
<label :for="path">Tag {{ index + 1 }}</label>
<input
:id="path"
v-model="form.values.tags[index]"
v-bind="events"
:name="path"
type="text"
>
<NotMessage :path="path" />
</NotField>
<button
type="button"
@click="remove(index)"
>
Remove
</button>
</div>
<button
type="button"
@click="append('')"
>
Add tag
</button>
</NotArrayField>
</NotForm>
</template>- Nuxt 4 or later
- Node.js 24 or later for development in this repository
- A Standard Schema-compatible validator