Starting From Scratch
With nothing but an empty folder learn how to start building with Triplex.
This guide walks you through the minimum amount of steps to open a component inside Triplex. If you haven't already make sure to install Node.js and initialize a new project with npm init and follow the prompts.
Install Dependencies
This installs the required packages to your project and places them in its package.json file.
Terminal
npm install @types/react @types/react-dom @types/three @react-three/fiber react react-dom threeCreate a Component
This can be anything you want, here we create a box.
src/scene.tsx
export default function Scene() {
return (
<mesh>
<boxGeometry args={[1, 1, 1]} />
<meshStandardMaterial color="red" />
</mesh>
);
}Open It Inside Triplex
Continue building with either Triplex for VS Code or Triplex Standalone.
Common Questions
Why is a tsconfig.json file created when opening a component?
The Scene Panel is populated by your component props sourced by the TypeScript compiler which needs this file.