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

asljs-components

v0.1.3

Published

Web components for ASLJS applications.

Downloads

436

Readme

components

Part of Alexandrite Software Library - a set of high-quality, performant JavaScript libraries for everyday use.

Overview

asljs-components is a catalog of reusable UI components for web applications in the ASLJS monorepo.

This package is component-oriented: each component has a custom element name, purpose, and usage pattern.

Installation

npm install asljs-components

NPM Package: asljs-components

Component Contract At A Glance

  • Import the package with import 'asljs-components'; to register the custom element.
  • The current custom element is asljs-list.
  • The required row template is template[data-slot="item"].
  • Optional templates are template[data-slot="empty"] and template[data-slot="container"].
  • If a container template is provided, it must include [data-role="items"].
  • Row bindings expose item, index, first, last, odd, even, count, and context.

When To Use This Package

  • Use asljs-components when you want reusable web components already shaped around ASLJS binding patterns.
  • Use asljs-data-binding directly when you only need declarative DOM binding without a packaged component.

Configuration Surface

The main configuration surface for asljs-list is:

  • list.items
  • list.context
  • child templates through documented data slots

Do not look for React-style render callbacks, prop-driven row renderers, or custom callback protocols as the primary configuration model.

Limitations

  • Only documented slots are supported.
  • Item rendering depends on templates, not imperative row callbacks.
  • Event integration follows asljs-data-binding path-based handler rules.
  • Container templates must contain [data-role="items"].

Components

List

  • Name: List
  • Custom element: asljs-list
  • Purpose: render collections from templates with row context binding.

Notes:

  • Uses template[data-slot="item"] for row rendering.
  • Supports optional template[data-slot="empty"] for empty state.
  • Supports optional template[data-slot="container"] with required data-role="items" insertion point.
  • Supports optional context object for shared row actions and state.

How Row Actions Receive Row Data

  • Reference shared actions through the row context, for example data-bind-onclick="context.select".
  • Row-specific values arrive through the derived row-local this context.
  • That derived context includes row fields like item and index.
  • Do not invent inline argument syntax like select(item.id).
import 'asljs-components';

const list =
  document.createElement('asljs-list');

list.context = {
  select(this: { item: { id: string; title: string } }, event: Event) {
    event.preventDefault();
    console.log('selected', this.item.id, this.item.title);
  }
};

list.innerHTML = `
  <template data-slot="container">
    <section class="rows" data-role="items"></section>
  </template>

  <template data-slot="empty">
    <div>No items</div>
  </template>

  <template data-slot="item">
    <div>
      <a data-bind-href="item.url"
         data-bind-text="item.title"
         data-bind-onclick="context.select"></a>
      <small data-bind-text="index"></small>
    </div>
  </template>
`;

list.items =
  [ { title: 'First', url: '/first' },
    { title: 'Second', url: '/second' } ];

Common Wrong Assumptions

  • This is not React-style callback rendering.
  • This is not template-expression syntax with inline function calls.
  • Row actions should not pass arguments in attributes.
  • Any container template shape is acceptable.
  • Item rendering is driven by imperative callbacks instead of templates.

List API Reference

Exports:

  • List
  • ListItem type
  • ListItemsSource type
  • ListRowContext type

List row binding context fields:

  • item: current row record
  • index: zero-based row index
  • first: true for the first row
  • last: true for the last row
  • odd: true for odd row positions
  • even: true for even row positions
  • count: total item count
  • context: shared base context adapted to the current row

Related Packages

  • For generic DOM binding rules, see asljs-data-binding.
  • For state reactivity, see asljs-observable.
  • For event primitives, see asljs-eventful.

Safe Authoring Rules

  • Keep row templates declarative.
  • Use context methods for shared row actions.
  • Avoid custom attribute protocols.
  • Do not mutate slot templates at runtime.
  • Update list.items or the source collection instead of rewriting row DOM.

License

MIT License. See LICENSE for details.