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

@chinggis.systems/collection-ui

v1.0.3

Published

Reusable React collection layout renderer with app-provided link, image, and item adapters.

Readme

@internom/collection-ui

Reusable React renderer for Internom collection layouts.

The package owns normalized collection rendering, commerce-oriented item cards, book-spine media, price/rich-text fallbacks, Swiper carousel rendering, Collection V2 normalization, and Internom storefront defaults. Apps can pass raw collection data through props and only override adapters when they need framework-specific behavior.

Install

yarn add @internom/collection-ui

Import the package stylesheet once. It includes the Swiper base/navigation CSS used by CollectionCarousel.

import "@internom/collection-ui/styles.css";

Simple Usage

import { CollectionView } from "@internom/collection-ui";
import "@internom/collection-ui/styles.css";

export function CollectionPreview({
  collection,
  renderStyle,
}: {
  collection: unknown;
  renderStyle?: unknown;
}) {
  return (
    <CollectionView
      collection={collection as any}
      renderStyle={renderStyle as any}
      className="collection-ui--dark collection-ui--preview"
    />
  );
}

Use collection-ui--preview inside admin panes. It keeps media/images smaller, caps the preview height so the form controls stay usable, and prevents preview links from navigating away from the form. Drop that class for storefront/full-page rendering.

CollectionView accepts Collection V2 fields modeled after shared/model/core/collection/collection.model.ts:

normalizeCollection({
  id: "collection-id",
  title: "Онцгой бүтээгдэхүүн",
  image: "https://example.com/banner.jpg",
  link: "/collection/special",
  layout: {
    variant: "SPECIAL",
    direction: "HORIZONTAL",
    columns: 6,
  },
  items: [
    {
      id: "item-id",
      productId: "product-id",
      title: "A Little Life",
      author: "Hanya Yanagihara",
      imageUrl: "a-little-life.jpg",
      price: 36900,
      discountPrice: 42900,
      type: "BOOK",
    },
  ],
});

Exports

import {
  BookSpine,
  CollectionCarousel,
  CollectionRenderer,
  CollectionView,
  getCollectionLayoutControls,
  getCollectionLayoutDefinition,
  createCollectionRendererAdapters,
  isCollectionLayoutControlVisible,
  normalizeCollection,
  normalizeCollectionLayout,
} from "@internom/collection-ui";

Admin Layout Controls

Admin forms should not show every control for every template. Ask the package which controls are valid:

import {
  getCollectionLayoutDefinition,
  isCollectionLayoutControlVisible,
} from "@internom/collection-ui";

const definition = getCollectionLayoutDefinition(layout.name);

const showDirection = isCollectionLayoutControlVisible(layout.name, "direction");
const showShape = isCollectionLayoutControlVisible(layout.name, "shape");
const showColumns = isCollectionLayoutControlVisible(layout.name, "columns");

// Render controls from definition.directionOptions / shapeOptions / columnOptions.

Examples:

  • special, banner, hero: hide direction, shape, and columns.
  • carousel, grid, featured, image-grid: show columns.
  • image-grid: show shape.
  • list, dynamic: show direction and numbered toggle.

Optional App Integration

The built-in package skin is framework-free and production-oriented. If an app needs app-specific components, provide adapters:

  • renderLink for router links.
  • renderImage for optimized images.
  • renderCarousel for custom Swiper controls.
  • renderBookMedia for custom spine/media.
  • renderPrice for app price formatting.
  • renderHtml for app rich-text clamping.
  • renderItem for app product cards.

Admin Checklist

If admin preview still looks different from internom.mn:

  • Use real REST item data, not placeholder cards.
  • Use CollectionView for the default independent package renderer, or normalizeCollection with CollectionRenderer for low-level control.
  • Import @internom/collection-ui/styles.css.
  • Use className="collection-ui--dark collection-ui--preview" in admin panes.
  • Override adapterOptions only when a host app has different routes, image hosts, or item type names.
  • Ensure the admin preview shell is not adding a conflicting fixed card/background around the collection if you expect full-width storefront parity.

Build

yarn build

The build emits ESM JavaScript, source maps, CSS, and TypeScript declarations into dist.