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

@parallelogram-js/core

v0.2.8

Published

A lightweight, enhancement-first JavaScript framework for progressive web applications

Readme

Parallelogram-JS

A lightweight, enhancement-first JavaScript framework for progressive web applications.

Features

  • 🎯 Progressive Enhancement - HTML first, JavaScript enhances
  • 📊 Data-Driven - data-[component]-[param] attribute pattern
  • 🎨 BEM CSS - .block__element--modifier class pattern
  • ♿ Accessible - ARIA attributes, keyboard navigation
  • 🔧 Modular - Use only what you need
  • 🧩 Web Components - Self-contained custom HTML elements

Quick Start

Option 1: Framework with ComponentRegistry (Recommended)

Full framework with lifecycle management, routing, and component registry:

npm install @parallelogram-js/core
import { ComponentRegistry, PageManager, EventManager } from '@parallelogram-js/core';

/* Import Web Components - they auto-register */
import '@parallelogram-js/core/components/PModal.js';
import '@parallelogram-js/core/components/PDatetime.js';
import '@parallelogram-js/core/components/PSelect.js';

/* Register regular enhancement components */
const registry = ComponentRegistry.create()
  .component('lazysrc', '[data-lazysrc]', {
    loader: () => import('@parallelogram-js/core/components/Lazysrc.js')
  })
  .component('modal', '[data-modal][data-modal-target]', {
    loader: () => import('@parallelogram-js/core/components/Modal.js')
  })
  .component('tabs', '[data-tabs]', {
    loader: () => import('@parallelogram-js/core/components/Tabs.js')
  })
  .build();

/* Initialize PageManager */
const eventBus = new EventManager();
const pageManager = new PageManager({
  containerSelector: '[data-view="main"]',
  registry,
  eventBus
});

HTML:

<!-- Web Components: Use as custom HTML elements -->
<p-modal id="example-modal" data-modal-size="md">
  <h2 slot="title">Modal Title</h2>
  <p>Content goes here</p>
</p-modal>

<p-datetime name="eventDate" mode="date"></p-datetime>

<!-- Regular Components: Use data attributes on standard elements -->
<img data-lazysrc="/path/to/image.jpg" alt="Lazy loaded image">
<button data-modal data-modal-target="#example-modal">Open Modal</button>
<div data-tabs>...</div>

Option 2: Web Components Only (No Framework)

Use just the Web Components without the framework:

/* Import only the Web Components you need */
import '@parallelogram-js/core/components/PModal.js';
import '@parallelogram-js/core/components/PDatetime.js';
import '@parallelogram-js/core/components/PSelect.js';

/* That's it! Use them directly in HTML */

HTML:

<button onclick="document.getElementById('my-modal').open()">
  Open Modal
</button>

<p-modal id="my-modal">
  <h2 slot="title">Simple Modal</h2>
  <p>No framework needed!</p>
</p-modal>

<p-datetime name="date" mode="date"></p-datetime>
<p-select name="country" placeholder="Select country">
  <option value="us">United States</option>
  <option value="ca">Canada</option>
</p-select>

Option 3: Individual Components

Use specific enhancement components without the full framework:

import { Lazysrc } from '@parallelogram-js/core';

/* Mount on specific elements */
const lazyLoader = new Lazysrc();
document.querySelectorAll('[data-lazysrc]').forEach(el => {
  lazyLoader.mount(el);
});

/* Or enhance all matching elements */
Lazysrc.enhanceAll('[data-lazysrc]');

Component Types

Parallelogram-JS has two types of components:

1. Regular Components (Enhancement)

Progressive enhancement components that enhance existing HTML:

  • Lazysrc, Toggle, Carousel, Tabs, Scrollreveal
  • Modal, Toast, DataTable, Lightbox, FormEnhancer

Pattern: Import → Register in ComponentRegistry → Use data attributes

2. Web Components (Custom Elements)

Self-contained custom HTML elements that work standalone:

  • PModal, PDatetime, PSelect, PToasts, PUploader

Pattern: Import → Use as HTML tags (no registration needed)

📚 See Web Components Guide for detailed differences

Available Components

Web Components

| Component | Tag | Purpose | |-----------|-----|---------| | PModal | <p-modal> | Modal dialogs with slots | | PDatetime | <p-datetime> | Date/time picker with ranges | | PSelect | <p-select> | Enhanced select dropdown | | PToasts | <p-toasts> | Toast notification container | | PUploader | <p-uploader> | File upload with drag-drop |

Regular Components

| Component | Selector | Purpose | |-----------|----------|---------| | Lazysrc | [data-lazysrc] | Lazy load images/media | | Modal | [data-modal] | Modal trigger enhancement | | Toast | [data-toast-trigger] | Toast notifications | | Tabs | [data-tabs] | Tab navigation | | Toggle | [data-toggle] | Toggle visibility | | Carousel | [data-carousel] | Image carousel | | Scrollreveal | [data-scrollreveal] | Scroll animations | | Scrollhide | [data-scrollhide] | Hide on scroll | | DataTable | [data-datatable] | Sortable/filterable tables | | Lightbox | [data-lightbox] | Image lightbox | | FormEnhancer | [data-form-validator] | Form validation |

Documentation

Development

npm install
npm run build        # Build framework
npm run build-css    # Build CSS only
npm run demo         # Run demo at localhost:3000

License

MIT