Catalog npm
PACKAGE EXPLORERView in registry

3d-ar-product-card

npm

A lightweight React component for displaying products in both Augmented Reality (AR) and 3D. Perfect for eCommerce applications where you want to showcase your products in an immersive and interactive way.

3d3d-ar3d-model3d-viewarar-productaugmented-realityecommerceinteractive-3dproduct-cardreactreact-3dreact-arreact-ar-cardxr
Versions collected177
Direct dependencies19From release 3.4.27
Last observed20 Oct, 19:32 UTC

README

Current package documentation

AR 3D Product Card

A lightweight React component for displaying products in both Augmented Reality (AR) and 3D. Perfect for eCommerce applications where you want to showcase your products in an immersive and interactive way.

Installation

You can install the package via npm or yarn:

npm install 3d-ar-product-card

Usage

import { AR3DProductCard } from '3d-ar-product-card';

Basic Example

import React from 'react';
import { AR3DProductCard } from '3d-ar-product-card';

function App() {
  return (
    <div>
      <AR3DProductCard 
        gltfPath="/models/indoor_plant/scene.gltf" 
        imageSrc="/image/1.png" 
      />
    </div>
  );
}

export default App;

Props

  • gltfPath (string): The path to the 3D model file (GLTF format).

  • imageSrc (string): The image to display on the product card.

Setup Require

Make this src/components folder name as Arcomponent.jsx

import { XrHitModelContainer } from '3d-ar-product-card';
import { useLocation } from 'react-router-dom';
import { XrHitModelContainer } from '3d-ar-product-card';

const Arcomponent = () => {
  const location = useLocation();
  const params = new URLSearchParams(location.search);
  const gltfPath = params.get('gltfPath') || './models/default.gltf';

console.log(gltfPath);


  console.log("gltfPath:", gltfPath); // Log the gltfPath for debugging

  return (
    <>
      {gltfPath ? (
        <XrHitModelContainer gltfPath={gltfPath} />
      ) : (
        <p>Error: No valid GLTF path provided.</p>
      )}
    </>
  );
};

export default Arcomponent;


Make route 'xr' of this component

Example



import Arcomponent from "./components/Arcomponent";

const App = () => {
  return(
  <Routes>
   <Route path="/xr" element={<Arcomponent />} />
  </Routes>
 
)};

export default App;

Features

  • AR and 3D views: Allows users to view products in Augmented Reality or 3D directly in their browser.
  • Customizable product card: Easily add products to the card with customizable properties like model path, scale, position, and image.
  • Mobile and Desktop Support: Automatically adjusts based on the device (mobile devices for AR and desktops for 3D).
  • Easy Integration: Simple to use in any React application.

License

MIT License.

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Versions 177

Collected releases
VersionPublishedDirect dependenciesOpen version
3.4.27Registry latest12 Feb 202519
3.4.2612 Feb 202519
3.4.2512 Feb 202519
3.4.2411 Feb 202519
3.4.2311 Feb 202519
3.4.2211 Feb 202519
3.4.2111 Feb 202519
3.4.2011 Feb 202519
3.4.1911 Feb 202519
3.4.1811 Feb 202519
3.4.1711 Feb 202519
3.4.1611 Feb 202519
3.4.1511 Feb 202519
3.4.1411 Feb 202519
3.4.1311 Feb 202519
3.4.1227 Jan 202519
3.4.1127 Jan 202519
3.4.1027 Jan 202519
3.4.927 Jan 202519
3.4.827 Jan 202519

Package advisories

0
No matching advisories collected

This describes our collected data; it is not a security assessment.

Metadata history

Meaningful changes
Current collected state Current

Observed since 20 Oct, 19:32 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package:e91e77c5d7360b78536a7b4a99099bdc5582a17a73de2288067b1a3c12e54162