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

@devx-labs/strapi-preview

v1.0.7

Published

Strapi 5 plugin that adds a preview-image custom field (configured per component in the Content-Type Builder with a direct image URL) and renders a side panel in the edit view showing each component's preview image in dynamic-zone order.

Readme

@devx-labs/strapi-preview

A Strapi 5 plugin that adds a preview image URL field to any component and renders all component previews as a side panel in the edit view.

Component authors set the image URL once in the Content-Type Builder (no Media Library required — any HTTPS URL works), and the panel displays the matching image live for every component on the entry. Dynamic-zone reorders are reflected immediately, and components without a configured preview are simply skipped.

Install

npm install @devx-labs/strapi-preview
# or
yarn add @devx-labs/strapi-preview
# or
bun add @devx-labs/strapi-preview

Strapi auto-discovers the plugin from node_modules on next boot — no config/plugins.ts entry required.

If you want to disable it or pass options later, the plugin's internal id is component-preview-image (set via strapi.name). Use that as the key in config/plugins.ts, e.g. 'component-preview-image': { enabled: false }.

Rebuild the admin:

npm run build

Add the preview field to your components

In Strapi's Content-Type Builder, edit a component → Add another fieldCustom → pick "Preview Image". Name the field exactly preview (any name works, but preview is the convention).

In the field's Base settings, fill in Preview Image URL with a direct image URL (Shopify CDN, S3, Cloudinary, picsum, anything reachable by the browser).

Usage

  1. Configure the preview field on each component you want to preview (URL is set once per component schema in CTB).
  2. Open any entry that uses your components — for example a Page with a dynamic zone of blocks.
  3. The Component previews side panel on the right shows every component on the entry, with its preview image, in the current dynamic-zone order.
  4. The custom field itself renders a small Preview ↗ button inside each component instance so editors can quickly open the full image in a new tab.

Behavior

  • Dynamic zone: panel items appear in the current order. Reorder components → panel reorders live (no save required).
  • Components without a configured preview URL are silently skipped.
  • Regular (non-dynamic-zone) component fields are also rendered, including repeatable components.
  • No Media Library coupling: URLs are plain strings, so previews can live on any CDN — useful when your component thumbnails live separately from your production media (e.g. a private design-system bucket).

CSP note

If your preview URLs point to external hosts (Shopify CDN, etc.), make sure your CSP img-src permits them. The simplest broad allow is "https:" in config/middlewares.ts:

'img-src': ["'self'", 'data:', 'blob:', 'https:', 'market-assets.strapi.io'],

What the plugin registers

  • Custom field type: plugin::component-preview-image.preview-image (stored as string)
  • Custom field UI: a compact Preview ↗ link button rendered inside each component instance
  • Content-Manager edit-view side panel: Component previews
  • Content-API route: GET /api/component-preview-image/options returning a { [componentUid]: { name, url } } map (used internally by the side panel)

Supported Strapi versions

Strapi 5.x

License

MIT