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

pass-prop

v0.0.37

Published

Web component that passes from a higher component down

Readme

pass-prop

pass-prop is a web component that passes a prop from a higher component to downstream siblings. It shares much common code and syntax with other components of the p-et-alia framework of components, but, like the other components in that framework, pass-prop can serve a useful purpose as a standalone component. The other components in the framework have a name that is globally unique (based on npm package name uniqueness constraints), but also have shorter "nicknames" which might clash with other libraries. In the case of pass-prop, that nickname is "p-p".

Syntax

<my-custom-element>
    #shadowDOM
        <laissez-dom>
            <template>
                <pass-prop from-host observe-prop=items to=[-list] ></pass-prop>
                <i-bid -list></i-bid>
            </template>
        </laissez-dom>
</my-custom-element>

Purpose

One of the most boring boilerplate tasks for markup-centric web components (which may see a resurgence with HTML Modules) is passing public properties of the web component down to sub components within its Shadow DOM realm (possibly with some minor modifications). And boilerplate JS is expensive, both in terms of performance, and incurs higher risk maintenance costs. In other words, pass-prop places a premium on declarative binding, over boilerplate JS.

Additionally, as seen in the example above, web component libraries may not have a very clear strategy as far as allowing sub-components to "spontaneously" generate content, which then needs to partake in binding to the host.

Alternatives

With template instantiation, some of that binding could be built into the platform. But it is unclear how extensive that binding will be at this time. For example, will template instantiation support inserted DOM nodes, post node cloning, i.e. lazy loaded content?

A component like pass-prop may be just enough to allow a web component to remain 100% declarative, even as the complexity of the component increases, should declarative web components become a thing.

Assumptions

pass-prop assumptions that property changes of interest will be paired with dispatched events. It assumes that the name of the event will be the lisp-cased name of the property, followed by a "-changed.". However, we can specify a specific event name to listen to via property/attribute propChangeEventName/prop-change-event-name.

Some checklists of good web component design advocate not firing events associated with public properties where the value is passed in. However, it does fit a useful purpose, in conjunction with a web component like pass-prop. A good comprise might be to automatically "echo" the public property to a less advertised "doppel"-prop.

API Reference