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

react-body-map-3d-sdk

v1.0.0

Published

Interactive 3D human body map React component with multi-language support

Readme

React Body Map 3D SDK

Interactive 3D human body map React component with multi-language support, built with Three.js and React Three Fiber.

✨ Features

  • 🎨 Full 3D interaction - Rotate, zoom, and pan
  • 🌍 Multi-language - 6 languages supported
  • 🎯 Clickable body parts - Interactive mesh selection
  • ⚡ Smooth animations - Breathing effect and transitions
  • 🎮 Intuitive controls - Mouse/touch gestures
  • 🪶 Optimized - Efficient rendering with Three.js
  • 📱 Responsive - Works on desktop and mobile

📦 Installation

npm install react-body-map-3d-sdk three @react-three/fiber @react-three/drei

🚀 Quick Start

import { BodyMap3D } from 'react-body-map-3d-sdk';
import 'react-body-map-3d-sdk/styles';

function App() {
  const handleSelect = (id, part) => {
    console.log('Selected:', part.name, part.category);
  };

  return (
    <BodyMap3D
      lang="en"
      onSelect={handleSelect}
      autoRotate={false}
    />
  );
}

📖 Props API

| Prop | Type | Default | Description | |------|------|---------|-------------| | lang | string | "en" | Language: en, fr, de, es, it, nl | | selectedPartId | number \| null | undefined | Controlled selection | | onSelect | (id, part) => void | undefined | Selection callback | | colors | object | See below | Color configuration | | showHeader | boolean | true | Show/hide header | | showControls | boolean | true | Show/hide control hints | | autoRotate | boolean | false | Auto-rotate model | | onLanguageChange | (lang) => void | undefined | Language change callback | | modelUrl | string | undefined | Custom 3D model (.glb) | | className | string | "" | Additional CSS class | | style | object | {} | Inline styles |

Colors Object

{
  default: "#8b8b8d",    // Default mesh color
  hover: "#a0a0a2",      // Hover state color
  selected: "#ff3b30"    // Selected state color
}

💡 Usage Examples

Controlled Mode

import { useState } from 'react';
import { BodyMap3D } from 'react-body-map-3d-sdk';

function ControlledExample() {
  const [selectedId, setSelectedId] = useState(null);
  const [language, setLanguage] = useState('en');

  return (
    <BodyMap3D
      lang={language}
      selectedPartId={selectedId}
      onSelect={(id, part) => {
        setSelectedId(id);
        console.log('Selected:', part);
      }}
      onLanguageChange={setLanguage}
    />
  );
}

Custom Colors

<BodyMap3D
  colors={{
    default: "#2c3e50",
    hover: "#34495e",
    selected: "#e74c3c"
  }}
/>

Auto-Rotate

<BodyMap3D
  autoRotate={true}
  showControls={false}
/>

Custom 3D Model

<BodyMap3D
  modelUrl="/models/human-body.glb"
  lang="fr"
/>

🎮 Controls

  • Left Mouse / Touch: Rotate model
  • Right Mouse / Two Fingers: Pan camera
  • Scroll / Pinch: Zoom in/out
  • Click: Select body part

📊 Data Utilities

import {
  get3DBodyParts,
  getBodyPartsByCategory,
  getBodyPartById,
  BODY_CATEGORIES
} from 'react-body-map-3d-sdk';

// Get all body parts
const parts = get3DBodyParts('en');

// Get parts by category
const legParts = getBodyPartsByCategory('en').legs;

// Find specific part
const part = getBodyPartById('en', 19); // Head

// Available categories
console.log(BODY_CATEGORIES);
// { HEAD: 'head', NECK: 'neck', TORSO: 'torso', ... }

🎨 Body Part Structure

Each body part includes:

{
  id: 19,
  name: "Head (ant.)",
  category: "head",
  meshNames: ["head", "skull", "face"],
  position: [0, 1.6, 0]  // 3D position for camera focus
}

🌍 Supported Languages

  • 🇬🇧 English (en)
  • 🇫🇷 French (fr)
  • 🇩🇪 German (de)
  • 🇪🇸 Spanish (es)
  • 🇮🇹 Italian (it)
  • 🇳🇱 Dutch (nl)

🎯 Body Categories

  • HEAD - Head and face
  • NECK - Neck region
  • TORSO - Chest, back, abdomen
  • ARMS - Upper and lower arms
  • HANDS - Hands and fingers
  • LEGS - Thighs, knees, calves
  • FEET - Feet and toes

🔧 Advanced Usage

With Custom Model

To use your own 3D model:

  1. Export model as .glb or .gltf
  2. Ensure mesh names match body part meshNames
  3. Pass model URL to component
<BodyMap3D
  modelUrl="/models/custom-body.glb"
/>

Mesh Naming Convention

Your 3D model meshes should follow this naming:

  • head, skull, face
  • neck_left, neck_right
  • shoulder_left, shoulder_right
  • bicep_left, bicep_right
  • etc.

📱 Responsive Design

The component automatically adapts to different screen sizes:

<BodyMap3D
  style={{ height: '100vh' }}  // Full viewport height
/>

⚡ Performance Tips

  1. Use production build for better performance
  2. Limit auto-rotate on mobile devices
  3. Optimize custom models (< 5MB recommended)
  4. Use LOD (Level of Detail) for complex models

🆚 2D vs 3D Comparison

| Feature | 2D SDK | 3D SDK | |---------|--------|--------| | File Size | ~52KB | ~200KB | | Interaction | Click | Rotate, zoom, click | | Visual | SVG paths | 3D meshes | | Performance | Faster | Good | | Use Case | Simple selection | Immersive experience |

🔗 Related Packages

📄 License

MIT

🤝 Contributing

Contributions welcome! Please open an issue or PR.

🐛 Issues

Report issues at: GitHub Issues