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

@rolemodel/spider

v0.0.9

Published

Shared high level web components for RoleModel Software and beyond

Downloads

615

Readme

Spider Web Components

By RoleModel Software

Spider is a set of reusable web components built with Lit. It currently provides:

  • rm-pdf-viewer: reskinned PDF viewer built on PDF.js
  • rm-tabs-root, rm-tabs-trigger, rm-tabs-panel: unstyled behavior-first tabs primitives

A customizable PDF viewer web component built on PDF.js. This component provides a reskinned, embeddable PDF viewing experience with text selection, zoom controls, thumbnail navigation, and theme customization.

Installation

yarn add @rolemodel/spider

Usage

Import once to register all components:

import '@rolemodel/spider'

Or import specific component modules from the package distribution output.

Development

yarn dev
yarn test

Components

PDF Viewer rm-pdf-viewer

PDF.js is awesome, but you will notice this paragraph in their setup instructions:

The viewer is built on the display layer and is the UI for PDF viewer in Firefox and the other browser extensions within the project. It can be a good starting point for building your own viewer. However, we do ask if you plan to embed the viewer in your own site, that it not just be an unmodified version. Please re-skin it or build upon it.

This component aims to be that skin layer built upon PDF.js packaged in a lovely drop-in web component.

Basic usage

<!doctype html>
<html>
  <body>
    <rm-pdf-viewer src="/path/to/document.pdf"></rm-pdf-viewer>
  </body>
</html>

With custom close button

<rm-pdf-viewer src="/document.pdf">
  <button slot="close-button" onclick="window.location.href='/'">
    Back to Home
  </button>
</rm-pdf-viewer>

Attributes / properties

| Name | Type | Default | Description | |------|------|---------|-------------| | src | string | '' | PDF URL/path | | open | boolean | false | Shows the viewer when present/true | | initial-page | number | 1 | Initial page to open | | theme-hue | number | 217 | Theme hue (0-360) | | theme-saturation | number | 89 | Theme saturation (0-100) | | escape-closes-viewer | boolean | false | Closes viewer on Escape when search is not open |

Slot

| Slot | Description | |------|-------------| | close-button | Custom close action element rendered in the toolbar |

Public methods

| Method | Description | |--------|-------------| | loadPDF() | Loads the PDF from src | | printPDF() | Opens browser print flow for the loaded PDF | | downloadPDF() | Downloads the current src | | fitPDFToScreen() | Applies calculated fit-to-screen zoom | | performSearch(term) | Searches text across pages | | goToNextMatch() / goToPreviousMatch() | Navigates search matches |

Tabs components

Tabs are split into three composable components so behavior is provided without enforcing styling.

rm-tabs-root

Owns the active tab state and coordinates triggers/panels.

| Name | Type | Description | |------|------|-------------| | active | string | Current active tab name |

rm-tabs-trigger

Declares a selectable tab trigger.

| Name | Type | Description | |------|------|-------------| | name | string | Tab name this trigger controls | | activeClass | string | Class toggled on slotted elements when active |

| Member | Type | Description | |--------|------|-------------| | isActive | getter | true when this trigger is selected | | activate() | method | Dispatches a tab select event for this trigger |

rm-tabs-panel

Declares content for a tab.

| Name | Type | Description | |------|------|-------------| | name | string | Tab name this panel belongs to |

| Member | Type | Description | |--------|------|-------------| | active | getter | true when this panel is visible | | activate() | method | Dispatches a tab select event for this panel |

Tabs event

| Event | Detail | Description | |-------|--------|-------------| | rm-tab-select | { name: string } | Emitted by triggers/panels to request active tab changes |

Tabs usage example

<rm-tabs-root class="tabs" active="first">
  <div role="tablist">
    <rm-tabs-trigger name="first" activeClass="active">
      <button type="button">First</button>
    </rm-tabs-trigger>
    <rm-tabs-trigger name="second" activeClass="active">
      <button type="button">Second</button>
    </rm-tabs-trigger>
  </div>

  <rm-tabs-panel name="first">
    <span>First tab content</span>
  </rm-tabs-panel>

  <rm-tabs-panel name="second">
    <span>Second tab content</span>
  </rm-tabs-panel>
</rm-tabs-root>

License

MIT