three-component

Create reusable React Three Fiber 3D components with TypeScript props.

1|Updated Dec 6, 2023
One-click install
npx skills add https://github.com/tadams95/kardashev-network --skill three-component
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: three-component
Source: https://github.com/tadams95/kardashev-network/tree/main/.claude/skills/three-component
Command: npx skills add https://github.com/tadams95/kardashev-network --skill three-component

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill provides a ready-to-use blueprint for creating new 3D components in a React Three Fiber project, accelerating the development of modular visual elements for the Kardashev Network visualization.

Core Features & Use Cases

  • Template-driven 3D component: A TypeScript React component template with props like intensity, color, position, and scale that can be reused across scenes.
  • Scene integration examples: Illustrates how to plug the component into a SunScene-like canvas with a data-driven animation loop.
  • Use Case: Extend the 3D visualization by adding a new component (e.g., a glow orb or particle group) controlled by irradiance (ghi) and cloudCover as in the provided templates.

Quick Start

Create a new file under src/components/three/ named ComponentName.tsx implementing the component template, then import and render it within SunScene with appropriate props.

Frequently Asked Questions about three-component

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create reusable 3D React components for Three.js visualizations?

To create reusable 3D React components, define a TypeScript props interface with properties like intensity, color, position, and scale. Place the file under src/components/three and import it into your React Three Fiber canvas scene for modular rendering.

What is the project structure for organizing React Three Fiber 3D components?

The recommended project structure for React Three Fiber 3D components places files under a dedicated src/components/three directory. This enforces a consistent architecture, ensuring modular visual elements like SunScene or particle groups remain easy to reuse across scenes.

Does this React Three Fiber template support data-driven animation loops?

Yes, the React Three Fiber template supports data-driven animation loops. Components plug into a SunScene canvas and control visual properties dynamically using data inputs such as irradiance (ghi) and cloudCover values within the scene's update cycle.

Can I use TypeScript props interfaces to control React Three Fiber scenes?

Yes, you can use TypeScript props interfaces to control React Three Fiber scenes. The template enforces TypeScript with a defined props interface, allowing you to pass dynamic values like color, position, and scale directly into your modular 3D elements.

How do I add a new 3D component to an existing React Three Fiber SunScene?

To add a new 3D component to a SunScene, create a new TypeScript file implementing the component template under src/components/three. Then, import and render the component within the SunScene canvas, passing appropriate props for scene integration.

What are the limitations of using template-driven 3D components in React Three Fiber?

A limitation of template-driven 3D components in React Three Fiber is that they are specifically scoped to Kardashev Network visualizations. They are tailored for elements like energy particles and cloud layers, requiring modification for unrelated 3D rendering use cases.