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

@useblok/forms

v0.1.1

Published

First-party form blocks for Blok. Docs: https://docs.useblok.dev

Readme

@useblok/forms

First-party form blocks for Blok. Drop a form onto a page, wire a webhook or a handler, done.

Install

npm install @useblok/forms @useblok/core

Quickstart

import type { Config } from "@useblok/core";
import { defineFormBlock } from "@useblok/forms";

const config: Config = {
  components: {
    // ...your other blocks
    Form: defineFormBlock({
      onSubmit: async ({ values, meta }) => {
        await fetch("/api/submit", {
          method: "POST",
          headers: { "Content-Type": "application/json" },
          body: JSON.stringify({ values, meta }),
        });
      },
    }),
  },
};

Authors can now drop a Form block into any page from the block library. Field schema is edited inline in the right panel — labels, input types, placeholders, required flags, select options, and help text.

What's shipped

| Input type | Rendered as | | ------------ | ---------------------- | | text | <input type="text"> | | email | <input type="email"> | | tel | <input type="tel"> | | url | <input type="url"> | | number | <input type="number">| | textarea | <textarea> | | select | <select> with options| | checkbox | <input type="checkbox">|

Submission flow:

  1. Client-side validation for required fields runs first.
  2. If defineFormBlock({ onSubmit }) was supplied, the handler is called with { values, meta }.
  3. Else if the form's action URL is set in the inspector, values + meta is POSTed as JSON.
  4. On success the block swaps to the successMessage. On error, a red error row appears above the submit button.

meta includes blockId, the per-form formId, the current path, and the configured action URL — enough to route submissions per-page.

API

defineFormBlock(options?)

Returns a ComponentConfig ready to drop into config.components.

| Option | Type | Notes | | ------------ | ------------------------------------------- | --------------------------------------------- | | label | string | Block library label. Default "Form". | | folder | string | Block library folder. Default "Content". | | accent | string | Accent color. Default #6b6cff. | | onSubmit | (submission) => void \| Promise<void> | Host-level handler. When set, skips fetch. | | defaults | Partial<FormBlockProps> | Seed values for new form instances. |

Types

  • FormFieldDef{ name, label, type, placeholder?, required?, options?, help? }
  • FormSubmission{ values, meta } payload passed to onSubmit
  • FormSubmitHandler — the onSubmit callback signature

Notes

  • Styling is inline on the renderer so the block ships looking clean with zero CSS setup. Override visuals by wrapping the block in a custom root, or fork the renderer.
  • The block is intentionally dumb — it submits the values it has. Server-side validation, spam protection, and storage are the host's job.