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

@vielzeug/craftit

v2.0.1

Published

> Functional web components with signals, typed props, and template bindings

Readme

@vielzeug/craftit

Functional web components with signals, typed props, and template bindings

npm version License: MIT

Craftit provides a compact API for authoring custom elements with fine-grained reactivity. It builds on @vielzeug/stateit (re-exported from the main entry) and adds component lifecycle, templating, typed props, context, slots/emits, form-associated helpers, and observer utilities.

Installation

pnpm add @vielzeug/craftit
# npm install @vielzeug/craftit
# yarn add @vielzeug/craftit

Quick Start

import { defineComponent, signal, computed, html } from '@vielzeug/craftit';

defineComponent({
  setup() {
    const count = signal(0);
    const doubled = computed(() => count.value * 2);

    return html`
      <button @click=${() => count.value++}>Count: ${count}</button>
      <p>Doubled: ${doubled}</p>
    `;
  },
  tag: 'my-counter',
});

Features

  • Component authoringdefineComponent({ tag, props, setup, ... })
  • Signals included — all @vielzeug/stateit exports are re-exported
  • Reactive templateshtml tagged template with text/attr/prop/event/ref bindings
  • Lifecycle helpersonMount, onCleanup, onError, handle, watch, effect, fire.*
  • Typed component APIsdefineComponent, prop, typed, setup-context emit and slots
  • Context / DIcreateContext, provide, inject, syncContextProps
  • Form-associated controlsdefineField with ElementInternals
  • Observer utilitiesobserveResize (main API) + observeIntersection / observeMedia (/labs)
  • Directive subpath@vielzeug/craftit/directives
  • Test subpath@vielzeug/craftit/test

Entry Points

| Entry | Purpose | |---|---| | @vielzeug/craftit | Main API (components + stateit re-exports) | | @vielzeug/craftit/directives | Directive helpers like each, when, bind, match, until | | @vielzeug/craftit/test | Mount/query/event testing utilities |

Usage Highlights

Typed props + emits

import { defineComponent, html } from '@vielzeug/craftit';

defineComponent<
  { disabled: boolean; label: string },
  { change: string }
>({
  props: {
    disabled: { default: false },
    label: { default: 'Name' },
  },
  setup({ emit, props }) {
    return html`
      <label>${props.label}</label>
      <input
        :disabled=${props.disabled}
        @input=${(e: Event) => emit('change', (e.target as HTMLInputElement).value)}
      />
    `;
  },
  tag: 'name-input',
});

Directives subpath

import { defineComponent, signal, html } from '@vielzeug/craftit';
import { each, when } from '@vielzeug/craftit/directives';

defineComponent({
  setup() {
    const todos = signal([{ id: 1, text: 'Write docs', done: false }]);

    return html`
      ${when(
        () => todos.value.length > 0,
        () => html`<ul>${each(todos, (todo) => html`<li>${todo.text}</li>`, () => html``, { key: (t) => t.id })}</ul>`,
        () => html`<p>No todos</p>`,
      )}
    `;
  },
  tag: 'todo-list',
});

Form-associated field

import { defineComponent, defineField, signal, html } from '@vielzeug/craftit';

defineComponent({
  formAssociated: true,
  setup() {
    const value = signal('');
    const field = defineField({ value });

    return html`
      <input
        type="email"
        :value=${value}
        @input=${(e: Event) => {
          value.value = (e.target as HTMLInputElement).value;
          field.setCustomValidity(value.value.includes('@') ? '' : 'Invalid email');
        }}
      />
    `;
  },
  tag: 'email-field',
});

API Summary

| Group | Main exports | |---|---| | Components | defineComponent, DefineComponentOptions, DefineComponentSetupContext, BuildPropSchema | | Runtime | onMount, onCleanup, onError, handle, aria, effect, watch, fire | | Props | prop, typed, PropOptions, PropDef, InferPropsSignals | | Slots / emits | setup-context slots, setup-context emit, onSlotChange, Slots, EmitFn | | Context | createContext, provide, inject, syncContextProps, InjectionKey | | Form | defineField, FormFieldOptions, FormFieldCallbacks, FormFieldHandle | | Observers | observeResize, observeIntersection, observeMedia | | Utilities | html, css, createId, createFormIds, guard, escapeHtml, toKebab | | Re-exported from stateit | signal, computed, batch, untrack, readonly, and more |

Documentation

Full docs at vielzeug.dev/craftit

| | | |---|---| | Overview | Install and architecture overview | | Usage Guide | Practical patterns and subpath usage | | API Reference | Complete signatures and types | | Examples | End-to-end component examples |

License

MIT © Helmuth Saatkamp — Part of the Vielzeug monorepo.