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

@scaleflex/asset-preview

v0.2.0

Published

Standalone asset preview modal for Scaleflex DAM — large media stage, variations (presets + custom), per-variation Embed/Options, read-only metadata, and Original/bundle (ZIP) download. Lit web component built on @scaleflex/dam-core; embeddable in light-d

Readme

@scaleflex/asset-preview

A standalone asset preview modal for the Scaleflex DAM — large media stage (image/video/audio/PDF/3D) with prev/next + zoom, a Variations list (Original + container presets + custom variants) with per-variation Embed / Options / Download, a read-only Metadata tab, an info grid, and Original / bundle (ZIP) download.

It is a Lit 3 web component (<sfx-asset-preview>) built on the shared @scaleflex/dam-core (headless variations/transform/archive data layer) and @scaleflex/dam-ui (the sfx-* primitives), matching the house format of @scaleflex/light-dam, @scaleflex/uploader, and @scaleflex/bulk-edit. It drops into light-dam (Lit) and Portals (React, via the ./react wrapper).

Plan: plan/13-asset-preview-module.md. Part of the scaleflex-dam-tools monorepo.

Distribution

| Import | Use | | ------------------------------- | -------------------------------------------------- | | @scaleflex/asset-preview | Element class + types + selected dam-core surface | | @scaleflex/asset-preview/define | Registers <sfx-asset-preview> (vanilla / any framework) | | @scaleflex/asset-preview/react | <AssetPreview> React wrapper (Portals, Spotlight) |

Quick start (vanilla)

import '@scaleflex/asset-preview/define';

const el = document.createElement('sfx-asset-preview');
el.config = { auth: { mode: 'sass-key', container: 'mycontainer', sassKey: 'KEY' } };
el.asset = asset;          // a dam-core Asset
el.assets = currentList;   // for prev/next
el.addEventListener('preview-close', () => el.remove());
document.body.appendChild(el);

React (Portals)

import { AssetPreview } from '@scaleflex/asset-preview/react';

<AssetPreview
  config={{ auth }}
  asset={asset}
  assets={list}
  features={{ metadata: true }}
  onClose={() => setOpen(false)}
  onDownload={(d) => console.log(d)}
/>;

Inputs

| Property | Type | Notes | | --------------- | ----------------------------- | -------------------------------------------------- | | config | AssetPreviewConfig | { auth, apiDomain? }. When set, the element fetches variations itself. | | asset | Asset | The asset to preview. | | assets | Asset[] | Surrounding list for prev/next. | | variations | Variation[] | Inject instead of fetching (fetch-or-inject). | | presets | Preset[] | Injected presets when the element fetches variants.| | metadataView | MetadataRow[] | Read-only rows for the Metadata tab. | | description | string | Short/AI description under the title. | | features | Partial<AssetPreviewFeatures> | Toggle variations / metadata / embed / download / bundleZip. |

Events

preview-close · asset-change {asset} · download {kind,…} · embed-copy {url} · error {message}.

Theming

Style via the --sfx-ap-* custom properties on the host (accent, fg, bg, border, radius …); they bridge onto the canonical --sfx-* tokens the embedded dam-ui primitives read, so one set themes the whole modal.

Develop

pnpm --filter @scaleflex/asset-preview dev         # offline dev harness (dev/)
pnpm --filter @scaleflex/asset-preview test        # vitest (jsdom)
pnpm --filter @scaleflex/asset-preview typecheck
pnpm --filter @scaleflex/asset-preview build       # ESM + CJS + d.ts (3 entries)
pnpm --filter @scaleflex/asset-preview build:cdn   # single IIFE