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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@arcmantle/adapter-element

v1.0.12

Published

Custom element wrapper using signals and lit-html.

Readme

@arcmantle/adapter-element

A modern custom element framework that bridges reactive signals with Web Components, providing an efficient and developer-friendly approach to building web components with automatic reactivity.

Overview

The Adapter Element framework provides a lightweight abstraction over native Web Components that combines:

  • Signal-based reactivity - Uses TC39 Signals proposal for efficient, fine-grained reactivity
  • Lit-html templating - Leverages the powerful and lightweight lit-html for declarative rendering
  • Dependency injection - Integrates with @arcmantle/injector for modular architecture
  • Decorator-driven development - Modern decorator syntax for defining properties and state
  • Automatic attribute synchronization - Seamless two-way binding between attributes and properties

Why Adapter Element?

Traditional Web Components require significant boilerplate and manual change detection. Adapter Element solves this by:

  1. Eliminating manual rendering triggers - Signal-based reactivity automatically re-renders when state changes
  2. Simplifying property management - Decorators handle attribute/property synchronization automatically
  3. Providing modern DX - Clean, class-based syntax with TypeScript support
  4. Maintaining Web Standards compliance - Built on top of standard Web Components APIs

Core Concepts

AdapterElement

The base class that your components extend. It provides:

  • Automatic change detection via signals
  • Lifecycle management (connected, disconnected, updated)
  • Template rendering with lit-html
  • Plugin system integration

Signal-based Reactivity

Uses the TC39 Signals proposal for reactive state management:

  • @state() - Internal component state that triggers re-renders
  • @property() - Properties synchronized with HTML attributes
  • Automatic dependency tracking and efficient updates

Two-Class Architecture

The framework uses a unique two-class approach:

  • AdapterElement - Your component logic and rendering
  • AdapterBase - Internal HTMLElement that manages the DOM integration

This separation provides clean APIs while maintaining full Web Component compatibility.

Quick Start

import { AdapterElement } from '@arcmantle/adapter-element/adapter';
import { customElement, property, state } from '@arcmantle/adapter-element/adapter';
import { html } from '@arcmantle/adapter-element/shared';

@customElement('my-counter')
class MyCounter extends AdapterElement {
  @property(Number) accessor count = 0;
  @state() accessor internalState = 'ready';

  protected render() {
    return html`
      <div>
        <p>Count: ${this.count}</p>
        <button @click=${this.increment}>+</button>
        <button @click=${this.decrement}>-</button>
      </div>
    `;
  }

  private increment = () => {
    this.count++;
  };

  private decrement = () => {
    this.count--;
  };
}

Exports

The package provides several entry points:

  • ./adapter - Core AdapterElement class and decorators
  • ./shared - Shared utilities (lit-html exports, CSS helpers, reactive controllers)
  • ./router - Client-side routing utilities

Project Status

⚠️ Work in Progress - This framework is currently in active development and APIs may change. Not recommended for production use yet.

Features

  • ✅ Signal-based reactivity
  • ✅ Decorator-driven property management
  • ✅ Lit-html templating integration
  • ✅ Dependency injection support
  • ✅ TypeScript support
  • ✅ Lifecycle management
  • 🚧 Router integration (in development)
  • 🚧 Comprehensive documentation
  • 🚧 Testing utilities

Dependencies

  • lit-html - Template rendering
  • signal-polyfill - TC39 Signals implementation
  • @arcmantle/injector - Dependency injection
  • @arcmantle/library - Utility functions