npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@warpkit/forms

v0.0.6

Published

Reactive form management with validation for Svelte 5 and WarpKit

Readme

@warpkit/forms

Schema-driven form state management for Svelte 5 with deep proxy binding.

Installation

bun add @warpkit/forms @warpkit/validation

Features

  • Schema validation - StandardSchema compatible (Zod, TypeBox, Valibot)
  • Deep binding - Transparent bind:value for nested objects
  • Array support - push, remove, insert, move operations
  • Validation modes - submit, blur, change, touched
  • Typed errors - Autocomplete for top-level field keys
  • Auto-cleanup - Timer cleanup via $effect (no manual onDestroy needed)

Usage

<script lang="ts">
  import { useForm } from '@warpkit/forms';
  import { Type } from '@sinclair/typebox';

  const schema = Type.Object({
    name: Type.String({ minLength: 1 }),
    email: Type.String({ format: 'email' }),
    tags: Type.Array(Type.String())
  });

  const form = useForm({
    schema,
    initialValues: { name: '', email: '', tags: [] },
    onSubmit: async (values) => {
      await saveUser(values);
    }
  });
</script>

<form onsubmit={form.submit}>
  <input bind:value={form.data.name} />
  {#if form.errors.name}
    <span class="error">{form.errors.name}</span>
  {/if}

  <input bind:value={form.data.email} />

  {#each form.data.tags as _, i}
    <input bind:value={form.data.tags[i]} />
    <button type="button" onclick={() => form.remove('tags', i)}>
      Remove
    </button>
  {/each}

  <button type="button" onclick={() => form.push('tags', '')}>
    Add Tag
  </button>

  <button type="submit" disabled={form.isSubmitting}>
    {form.isSubmitting ? 'Saving...' : 'Save'}
  </button>
</form>

API

useForm(options)

Options:

  • schema - StandardSchema for validation
  • initialValues - Initial form values
  • onSubmit - Submit handler
  • mode - Validation mode: 'submit' | 'blur' | 'change' | 'touched'
  • revalidateMode - Revalidation mode after error

Returns:

  • data - Proxied form values (use with bind:value)
  • errors - Typed field errors (autocomplete for top-level keys)
  • warnings - Field warnings
  • touched - Touched fields
  • dirty - Dirty fields
  • isDirty - Form has changes
  • isValid - No validation errors
  • isSubmitting - Submit in progress
  • isSubmitted - Form has been submitted
  • submitError - Error from last submit
  • submitCount - Number of submit attempts
  • submit(event?) - Form submit handler
  • reset(newValues?) - Reset to initial values
  • resetDirty() - Snapshot current values as dirty baseline
  • validate() - Validate entire form
  • validateField(field) - Validate single field
  • setField(field, value) - Set field value
  • setError(field, message) - Set/clear field error
  • setWarning(field, message) - Set/clear field warning
  • touch(field) - Mark field as touched
  • clearErrors() - Clear all errors and warnings
  • push(field, value) - Add to array
  • remove(field, index) - Remove from array
  • insert(field, index, value) - Insert into array
  • move(field, from, to) - Reorder array
  • swap(field, indexA, indexB) - Swap array items
  • field(path) - Get field-centric state view
  • cleanup() - Clean up timers (automatic via $effect)