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

@lucky-boy/planet-star

v1.0.0

Published

**PlanetStar** is a high-performance, interactive 3D lottery component built with **React** and **Three.js**. It features a visually stunning planet composed of user cards, dynamic animations, and a complete lottery flow control system.

Downloads

3

Readme

PlanetStar

PlanetStar is a high-performance, interactive 3D lottery component built with React and Three.js. It features a visually stunning planet composed of user cards, dynamic animations, and a complete lottery flow control system.

Features

  • 3D Planet Visualization: Renders hundreds of user cards on a rotating 3D sphere using Fibonacci distribution for even spacing.
  • High Performance: Optimized with Three.js, supporting efficient texture caching and particle systems.
  • Interactive Controls: Full control over the lottery process (Start, Pause, Stop, Reset).
  • Customizable: Extensive configuration options for visual appearance, animation speeds, and text content.
  • Async Data Support: Seamlessly handles asynchronous user data loading with fallback to demo data.
  • Tools: Built-in screenshot and screen recording capabilities (toggleable).
  • Responsive: Adapts to different screen sizes and aspect ratios.

Installation

pnpm add @lucky-boy/planet-star

Usage

import { PlanetStar, PlanetStarRef } from "@lucky-boy/planet-star";
import { useRef } from "react";

const App = () => {
  const planetRef = useRef<PlanetStarRef>(null);

  // User data (can be an array or a Promise)
  const users = [
    { id: "1", name: "User 1", avatarUrl: "..." }
    // ...
  ];

  return (
    <div style={{ width: "100vw", height: "100vh" }}>
      <PlanetStar
        ref={planetRef}
        users={users}
        demoUsers={[]} // Optional fallback data
      />
    </div>
  );
};

Configuration

The component exposes a settings modal (accessible via UI or ref) to adjust various parameters:

  • Visuals: Card count, size, scale, planet radius, particle count.
  • Animation: Spin speed, duration, auto-start delay.
  • Text: Customizable labels for all UI elements.
  • Tools: Toggle screenshot and recording buttons.

Key Technologies

  • Three.js: Core rendering engine for the 3D scene.
  • React: Component structure and state management.
  • Zustand: Global state management for the lottery system.
  • Tween.js: Smooth animations for camera movements and card effects.

Architecture

  • PlanetStar.tsx: Main entry point, handles React lifecycle, UI overlays, and data loading.
  • usePlanetStarScene.ts: Encapsulates all Three.js logic (Scene, Camera, Renderer, Animation Loop).
  • usePlanetStarStore.ts: Centralized state store for configuration and runtime status.

Performance Note

The Screenshot and Screen Recording features require preserveDrawingBuffer: true in the WebGL renderer. This is automatically managed based on the "Show Tools" configuration to ensure optimal performance when tools are not in use.