Skip to content

Latest commit

 

History

History

README.md

version npm downloads discord chat


TresJS Core

Declarative ThreeJS using Vue Components

  • 💡 Build 3D scenes with Vue components
  • ⚡️ Powered by Vite
  • 🎨 Vue custom renderer for Three.js
  • 🥰 Always up-to-date with the latest Three.js features
  • 🦾 Fully Typed

TresJS is a Vue custom renderer that lets you build Three.js scenes declaratively using Vue components. Any Three.js class can be used as a component by prefixing it with Tres (e.g., <TresMesh>, <TresBoxGeometry>).

Installation

pnpm i @tresjs/core three

TypeScript

Install Three.js type definitions:

pnpm i @types/three -D

Vite Configuration

Add the template compiler options to your vite.config.ts to make the custom renderer work and avoid console warnings:

import { templateCompilerOptions } from '@tresjs/core'
import vue from '@vitejs/plugin-vue'
import { defineConfig } from 'vite'

export default defineConfig({
  plugins: [
    vue({
      ...templateCompilerOptions,
    }),
  ],
})

Docs

Checkout the docs

Build

To build the package run:

pnpm run build

Test

pnpm run test

Playground

To run the playground:

pnpm run playground

License

MIT