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

@elenajs/components

v1.0.1

Published

Elena component library demonstrating how to build Progressive Web Components.

Readme

Elena component library demonstrating how to build Progressive Web Components

Table of contents

Install

npm install @elenajs/components

Usage

Import all components

Import the full bundle to register all components at once:

import "@elenajs/components";

Import individual components

Import only the components you need for better tree-shaking:

import "@elenajs/components/dist/button.js";
import "@elenajs/components/dist/spinner.js";
import "@elenajs/components/dist/stack.js";
import "@elenajs/components/dist/visually-hidden.js";

Import styles

Each component ships with a matching CSS file. Import the full bundle or individual files:

/* All component styles */
@import "@elenajs/components/dist/bundle.css";

/* Or individual styles */
@import "@elenajs/components/dist/button.css";
@import "@elenajs/components/dist/spinner.css";
@import "@elenajs/components/dist/stack.css";
@import "@elenajs/components/dist/visually-hidden.css";

Available components

Button

Renders a <button> element with built-in event delegation and variant styling.

<elena-button>Click me</elena-button>
<elena-button variant="primary">Save</elena-button>
<elena-button variant="danger">Delete</elena-button>
<elena-button disabled>Disabled</elena-button>

Props

| Prop | Type | Default | Description | | ---------- | ------------------------------------ | ----------- | ----------------------------------------------- | | variant | "default" \| "primary" \| "danger" | "default" | The style variant of the button. | | disabled | Boolean | false | Makes the component disabled. | | name | string | "" | The name used to identify the button in forms. | | value | string | "" | The value used to identify the button in forms. | | type | "submit" \| "reset" \| "button" | "button" | The type of the button. |

Events

| Event | Description | | ------- | ------------------------------------- | | click | Fires when the button is clicked. | | focus | Fires when the button receives focus. | | blur | Fires when the button loses focus. |

CSS custom properties

| Property | Description | | ----------------------- | --------------------------------------- | | --elena-button-text | Overrides the default text color. | | --elena-button-bg | Overrides the default background color. | | --elena-button-font | Overrides the default font family. | | --elena-button-radius | Overrides the default border radius. |

Spinner

Displays an animated loading indicator that inherits the current text color.

<elena-spinner></elena-spinner>

CSS custom properties

| Property | Description | | ----------------------- | ------------------------------------ | | --elena-spinner-size | Overrides the default size (20px). | | --elena-spinner-border| Overrides the default border width (2px). |

Stack

Manages flexbox layout of its children with optional spacing.

<elena-stack>
  <elena-button>First</elena-button>
  <elena-button>Second</elena-button>
</elena-stack>

<elena-stack direction="row">
  <elena-button>Left</elena-button>
  <elena-button>Right</elena-button>
</elena-stack>

Props

| Prop | Type | Default | Description | | ----------- | ------------------- | ---------- | ---------------------------------- | | direction | "column" \| "row" | "column" | The direction of the stack layout. |

Visually Hidden

Hides content visually while keeping it accessible to assistive technologies such as screen readers.

<elena-visually-hidden>Skip to main content</elena-visually-hidden>

No props. Content is passed as children.

TypeScript

The package ships with TypeScript declarations for JSX integration. To get type checking in your framework:

// types.d.ts
import type { CustomElements } from "@elenajs/components";

type ElenaIntrinsicElements = {
  [K in keyof CustomElements]: CustomElements[K] & {
    onClick?: (e: MouseEvent) => void;
    onFocus?: (e: FocusEvent) => void;
    onBlur?: (e: FocusEvent) => void;
    children?: React.ReactNode;
  };
};

declare module "react" {
  namespace JSX {
    interface IntrinsicElements extends ElenaIntrinsicElements {}
  }
}

Development

pnpm start    # Launch dev server with live reload
pnpm build    # Build to dist/ (via elena build)
pnpm clean    # Remove dist/

License

MIT

Copyright

Copyright © 2026 Ariel Salminen