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

@cds.id/splat-viewer

v3.11.0

Published

A Splat Viewer component for React

Readme

@cds.id/splat-viewer

A versatile Splat Viewer component available as both a Web Component and React component for displaying 3D Gaussian Splats with interactive controls.

About This Project

The Splat Viewer is a 3D visualization library that renders Gaussian Splat files (.splat) using the @mkkellogg/gaussian-splats-3d engine. It provides an interactive 3D viewer with camera controls, animation capabilities, and optimization features for web applications.

Key Features:

  • 3D Gaussian Splat rendering
  • Interactive camera controls with zoom and rotation
  • Animation support with gradual scene reveal
  • Intersection Observer for performance optimization
  • Custom styling support
  • Both Web Component and React component APIs

Installation

npm install @cds.id/splat-viewer

Web Component Usage

The Web Component provides a simple HTML tag interface for embedding Splat viewers in any web application.

Basic Usage

<!doctype html>
<html>
  <head>
    <script src="./dist/cds-splat.iife.js"></script>
  </head>
  <body>
    <cds-splat src="https://example.com/model.splat" animate class="my-splat-viewer"> </cds-splat>
  </body>
</html>

Web Component Props

| Attribute | Type | Required | Default | Description | | ----------- | ------- | -------- | --------- | ------------------------------------------------------------- | | src | string | ✓ | - | URL path to the .splat file to be rendered | | animate | boolean | - | false | Enable gradual scene reveal animation | | thumbnail | string | - | undefined | Thumbnail image URL (currently supported but not implemented) | | class | string | - | '' | CSS class name for custom styling |

Events

window.addEventListener('splat-ready', (event) => {
  console.log('Splat viewer ready:', event.detail.viewerId);
});

React Component Usage

The React component provides a more feature-rich interface with additional props for advanced customization.

Basic Usage

import React from 'react';
import SplatViewer from '@cds.id/splat-viewer';

function App() {
  return (
    <div style={{ width: '800px', height: '600px' }}>
      <SplatViewer src="https://example.com/model.splat" isAnimate={true} />
    </div>
  );
}

React Component Props

| Prop | Type | Required | Default | Description | | ----------------------- | ------------------------ | -------- | ------------------ | --------------------------------------------------------- | | src | string | ✓ | - | URL path to the .splat file to be rendered | | isAnimate | boolean | - | false | Enable gradual scene reveal animation | | thumbnail | string | - | undefined | Thumbnail image URL for loading state | | className | string | - | '' | CSS class name for custom styling | | position | [number, number, number] | - | [0, 2.5, 0] | 3D position offset for the splat model | | scale | [number, number, number] | - | [1, 1, 1] | 3D scale factors for the splat model | | initialCameraPosition | [number, number, number] | - | [-9.5, -3.3, -3.3] | Starting camera position in 3D space | | useObserver | boolean | - | true | Enable Intersection Observer for performance optimization |

Advanced Example

import React from 'react';
import SplatViewer from '@cds.id/splat-viewer';

function AdvancedViewer() {
  return (
    <SplatViewer
      src="https://example.com/model.splat"
      isAnimate={true}
      position={[0, 0, 0]}
      scale={[2, 2, 2]}
      initialCameraPosition={[-5, -2, -5]}
      useObserver={false}
      className="custom-splat-viewer"
    />
  );
}

Performance Considerations

  • The useObserver prop enables automatic loading only when the component is visible
  • Components automatically dispose of resources when unmounted
  • Optimized for streaming with built-in compression and memory management

Container Sizing

The component will adapt to its container size. Always wrap it in a container with defined dimensions:

// React
<div style={{ width: '90vw', height: '400px' }}>
  <SplatViewer src="path/to/splat.splat" />
</div>

<!-- Web Component -->
<div style="width: 90vw; height: 400px;">
  <cds-splat src="path/to/splat.splat"></cds-splat>
</div>

Development

  1. Clone the repository:
git clone https://github.com/cds-id/splat-viewer.git
  1. Install dependencies:
npm install
  1. Start development server:
npm run dev
  1. Build for npm:
npm run build:lib

Testing Locally

Test the package locally before publishing:

# In the package directory
npm run build:lib
npm link

# In your test project
npm link @cds.id/splat-viewer

Scripts

  • npm run dev - Start development server
  • npm run build:lib - Build for npm
  • npm run clean - Clean build directory
  • npm run lint - Run ESLint
  • npm run format - Format code with Prettier

Dependencies

Core:

  • React
  • React DOM
  • @mkkellogg/gaussian-splats-3d

Browser Support

  • Chrome (latest)
  • Firefox (latest)
  • Safari (latest)
  • Edge (latest)

Known Issues

  • Type declarations might need manual refresh in some IDEs
  • Web Component requires modern browser support

License

MIT License

Credits

Built with @mkkellogg/gaussian-splats-3d