GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - devlsh/form: Lightweight, type-safe forms for Vue.

BranchesTags
Open more actions menu

Latest commit

 

History

46 Commits
46 Commits

Folders and files

NameName
Last commit message
Last commit date
.github
.github
 
 
.openchamber
.openchamber
 
 
.vscode
.vscode
 
 
demo
demo
 
 
docs
docs
 
 
src
src
 
 
tests
tests
 
 
.editorconfig
.editorconfig
 
 
.gitignore
.gitignore
 
 
.manifest.json
.manifest.json
 
 
AGENTS.md
AGENTS.md
 
 
CHANGELOG.md
CHANGELOG.md
 
 
CODE_OF_CONDUCT.md
CODE_OF_CONDUCT.md
 
 
CONTRIBUTING.md
CONTRIBUTING.md
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
SECURITY.md
SECURITY.md
 
 
lefthook.yml
lefthook.yml
 
 
oxfmt.config.ts
oxfmt.config.ts
 
 
oxlint.config.ts
oxlint.config.ts
 
 
package.json
package.json
 
 
pnpm-lock.yaml
pnpm-lock.yaml
 
 
pnpm-workspace.yaml
pnpm-workspace.yaml
 
 
release.json
release.json
 
 
shim.d.ts
shim.d.ts
 
 
tsconfig.build.json
tsconfig.build.json
 
 
tsconfig.json
tsconfig.json
 
 
tsdown.config.ts
tsdown.config.ts
 
 
vitest.config.ts
vitest.config.ts
 
 

Repository files navigation

@devlsh/form

Lightweight, type-safe forms for Vue.


NPM Downloads GitHub Stars Build Status Software License


  • Interactive demo.
  • Typed field names and values.
  • Reactive field values and validation errors.
  • Field validation with async-validator rules.
  • Async submit callbacks with a loading state.
  • Default values, form reset, and manual field errors.

Installation

$ npm install @devlsh/form

Usage

Validate an email field before submission.

<template>
  <form novalidate @submit="submit">
    <label for="email">Email Address</label>
    <input
      id="email"
      name="email"
      type="email"
      autocomplete="email"
      required
      :disabled="loading"
      :aria-invalid="email.hasError"
      :aria-describedby="email.hasError ? 'email-error' : undefined"
      v-model="email.value"
    />

    <p id="email-error" role="alert" v-if="email.hasError">{{ email.error?.message }}</p>

    <button type="submit" :disabled="loading">Submit</button>
  </form>
</template>

<script setup lang="ts">
  import { useForm } from '@devlsh/form';

  interface MyForm {
    email: string;
  }

  const { useField, handle, loading } = useForm<MyForm>({
    defaults: { email: '' },
  });

  const email = useField('email', {
    type: 'email',
    required: true,
  });

  const submit = handle(async (values) => {
    console.log(values.email);
  });
</script>

Contributing

Report bugs through issues or ask questions in Discussions. Report vulnerabilities privately as described in SECURITY.md.

For local development, pull requests, and other contributions, see the Contributing Guidelines.

License

@devlsh/form is free and open-source software licensed under the MIT License.


devlsh.com  ·  GitHub: @devlsh  ·  X: @itsdevlsh

About

Lightweight, type-safe forms for Vue.

devlsh.com

Topics

async-validatorcomposableformtypescriptvalidationvuevue3

Resources

Readme
MIT license

Code of conduct

Code of conduct

Contributing

Contributing

Security policy

Security policy
Activity

Stars

25 stars

Watchers

2 watching

Forks

4 forks
Report repository

Releases

Sponsor this project

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.