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

@cardinal-odp/packing-3d-react

v0.1.0

Published

React component for 3D bin-packing scene visualization based on `three`, `@react-three/fiber`, and `@react-three/drei`.

Readme

@cardinal-odp/packing-3d-react

React component for 3D bin-packing scene visualization based on three, @react-three/fiber, and @react-three/drei.

The package only ships the React-side scene component and related types / palette helpers. Runtime dependencies are expected to be installed by the host application.

Install

npm install @cardinal-odp/packing-3d-react react react-dom three @react-three/fiber @react-three/drei

Peer Dependencies

  • react
  • react-dom
  • three
  • @react-three/fiber
  • @react-three/drei

three, @react-three/fiber, and @react-three/drei are declared as optional peers so the package can stay host-driven in monorepo and app integration scenarios.

Usage

import Packing3DScene from '@cardinal-odp/packing-3d-react';

const container = {
  innerLength: 12,
  innerWidth: 2.35,
  innerHeight: 2.69,
};

const items = [
  {
    id: 'cargo-1',
    groupKey: 'A',
    seq: 1,
    posX: 0,
    posY: 0,
    posZ: 0,
    xLength: 120,
    yLength: 100,
    zLength: 80,
    meta: {
      title: 'SKU-A-01',
      lines: ['批次: B001', '客户: North Hub'],
    },
  },
];

export default function Demo() {
  return (
    <Packing3DScene
      container={container}
      items={items}
      height={560}
      theme="light"
    />
  );
}

Data Model

container uses meters. Item position and dimensions use centimeters.

type SceneContainer = {
  innerLength: number;
  innerWidth: number;
  innerHeight: number;
};

type SceneItem = {
  id: string;
  groupKey: string;
  seq: number;
  posX: number;
  posY: number;
  posZ: number;
  xLength: number;
  yLength: number;
  zLength: number;
  meta?: {
    title?: string;
    lines?: string[];
  };
};

Props

| Prop | Type | Default | Description | | --- | --- | --- | --- | | container | SceneContainer | - | Scene container dimensions in meters | | items | SceneItem[] | - | Packed items rendered inside the container | | allItems | SceneItem[] | items | Optional source list for stable group color ordering | | unloadedItems | SceneItem[] | [] | Items rendered in the unloaded area | | highlightedIds | Set<string> | new Set() | When non-empty, only render items whose ids are included | | opacity | number | 0.75 | Opacity used for the unloaded zone overlay | | theme | 'light' \| 'dark' | 'light' | Built-in scene theme | | paletteTokens | Partial<ScenePalette> | undefined | Override scene palette tokens | | tooltipTokens | Partial<SceneTooltipTokens> | undefined | Override default tooltip tokens | | renderTooltip | (item, unloaded) => ReactNode | undefined | Custom tooltip renderer | | getItemColor | (item, groupKeys, theme) => string | default palette mapping | Custom item color resolver | | width | CSSProperties['width'] | '100%' | Root width | | height | CSSProperties['height'] | '100%' | Root height | | minHeight | CSSProperties['minHeight'] | 500 | Root min-height |

Exports

import Packing3DCore, {
  Packing3DScene,
  DARK_GROUP_COLORS,
  DARK_SCENE_PALETTE,
  DARK_SCENE_TOOLTIP_TOKENS,
  LIGHT_GROUP_COLORS,
  LIGHT_SCENE_PALETTE,
  LIGHT_SCENE_TOOLTIP_TOKENS,
  getDefaultGroupColor,
  getDefaultGroupColors,
  getDefaultScenePalette,
  getDefaultSceneTooltipTokens,
  getGroupColorByKey,
  resolveScenePalette,
  resolveSceneTooltipTokens,
  type Packing3DCoreProps,
  type SceneContainer,
  type SceneItem,
} from '@cardinal-odp/packing-3d-react';

Packing3DScene and Packing3DCore are the same component export.

Notes

  • The component includes a container wireframe, packed cargo cubes, and an unloaded-item zone.
  • Hover and filtered-highlight states share the same tooltip rendering pipeline.
  • The package is intentionally presentation-focused. Packing calculation, sorting, and business data mapping should stay outside.