Skip to content

Latest commit

Β 

History

676 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ™ŒπŸ½ Attaform

npm version npm downloads License Node.js Test Suite OpenSSF Scorecard OpenSSF Best Practices Nuxt

A type-safe, schema-driven form library for Vue 3 and Nuxt with first-class Zod support.

Hand a Zod schema to useForm and Attaform turns it into a reactive form, typed end-to-end, with live errors and SSR out of the box.

It scales from the simplest forms to the most comprehensive multistep wizards while keeping the core experience clear and focused.

Because Vue and Nuxt devs deserve nice things, too.

Try it live β†’ Tweak a schema, edit the template, and watch the form rebind in your browser. No install needed.

Quick start

npm install attaform zod
<script setup lang="ts">
  import { useForm } from 'attaform'
  import { z } from 'zod'

  const schema = z.object({
    email: z.email('Enter a valid email'),
    password: z.string().min(8, 'At least 8 characters'),
  })

  const form = useForm({ schema })

  const onSubmit = form.handleSubmit(async (values) => {
    await fetch('/api/sign-in', { method: 'POST', body: JSON.stringify(values) })
  })
</script>

<template>
  <form @submit="onSubmit">
    <label>
      Email
      <input v-register="form.register('email')" autocomplete="email" />
      <em v-if="form.fields.email.showErrors">{{ form.fields.email.firstError?.message }}</em>
    </label>
    <label>
      Password
      <input v-register="form.register('password')" type="password" autocomplete="off" />
      <em v-if="form.fields.password.showErrors">{{ form.fields.password.firstError?.message }}</em>
    </label>
    <button :disabled="form.meta.submitting" type="submit">Sign in</button>
  </form>
</template>

Hand the schema to useForm, bind each input with v-register, and Attaform owns the values, the coercion, the live errors, and the typed submit payload. That is the whole loop.

Full walkthrough β†’ Setting up Nuxt, Vite, or bare Vue? See the installation guide.

Highlights

  • The schema is the form. Types, defaults, validation, per-field errors, and the submit payload all flow from one Zod schema. No any, no manual type plumbing, on both Zod v3 and v4 from a single attaform/zod import. Why Attaform β†’
  • useForm is the core. A reactive, fully typed form: read form.values, form.errors, form.fields, and form.meta directly, then write with form.setValue, form.reset, and typed field-array helpers. The form β†’
  • useWizard for multistep. Compose forms into a flow with shared navigation, per-step validation, state retained across steps, and deep-link restore. useWizard β†’
  • SSR-native. Server-rendered HTML matches the hydrated client with no flash. Auto-wired in Nuxt, one Vite plugin for bare Vue. SSR in Nuxt β†’
  • DevTools built in. Inspect every form on the page, walk its history, and edit values live. No probes to install. DevTools panel β†’
  • Built for AI-assisted coding. Ships an llms.txt index, a full-text docs dump, and an installable Agent Skill (npx attaform skill), so your coding assistant writes idiomatic Attaform the first time. AI agents β†’
  • Secure by construction. Zero runtime dependencies (no supply-chain surface), prototype-pollution-safe deep writes, and Attaform never throws into your app. Security policy β†’

Documentation

Full docs live at attaform.dev.

Status

Pre-1.0. SemVer applies from v1.0 onward; 0.x minor bumps may still include breaking changes, each documented in the changelog.

Security

Found a vulnerability? Please report it privately through the security policy.

License

Β© 2026 Oswald Chisala. Released under the MIT License.

About

A type-safe, schema-driven form library for Vue 3 and Nuxt with first-class Zod support.

Topics

Resources

Contributing

Security policy

Stars

6 stars

Watchers

2 watching

Forks

Releases

Packages

Used by

Contributors

Languages