# Table of Contents
- [Overview – Theatre.js](#overview-theatre-js)
- [Overview – Theatre.js](#overview-theatre-js)
- [With THREE.js – Theatre.js](#with-three-js-theatre-js)
- [Releases – Theatre.js](#releases-theatre-js)
- [Concepts – Theatre.js](#concepts-theatre-js)
- [Releases – Theatre.js](#releases-theatre-js)
- [With React Three Fiber – Theatre.js](#with-react-three-fiber-theatre-js)
- [Concepts – Theatre.js](#concepts-theatre-js)
- [Getting started – Theatre.js](#getting-started-theatre-js)
- [With THREE.js – Theatre.js](#with-three-js-theatre-js)
- [With React Three Fiber – Theatre.js](#with-react-three-fiber-theatre-js)
- [With HTML/SVG – Theatre.js](#with-html-svg-theatre-js)
- [Getting started – Theatre.js](#getting-started-theatre-js)
- [Projects – Theatre.js](#projects-theatre-js)
- [Sheets – Theatre.js](#sheets-theatre-js)
- [Sheets – Theatre.js](#sheets-theatre-js)
- [Projects – Theatre.js](#projects-theatre-js)
- [Working with Sequences – Theatre.js](#working-with-sequences-theatre-js)
- [With HTML/SVG – Theatre.js](#with-html-svg-theatre-js)
- [Sheet Objects – Theatre.js](#sheet-objects-theatre-js)
- [Manual – Theatre.js](#manual-theatre-js)
- [Studio – Theatre.js](#studio-theatre-js)
- [Keyboard & Mouse Controls – Theatre.js](#keyboard-mouse-controls-theatre-js)
- [Prop types – Theatre.js](#prop-types-theatre-js)
- [Extensions – Theatre.js](#extensions-theatre-js)
- [Assets – Theatre.js](#assets-theatre-js)
- [Sheet Objects – Theatre.js](#sheet-objects-theatre-js)
- [Keyboard & Mouse Controls – Theatre.js](#keyboard-mouse-controls-theatre-js)
- [Studio – Theatre.js](#studio-theatre-js)
- [@theatre/react – Theatre.js](#-theatre-react-theatre-js)
- [Using Audio – Theatre.js](#using-audio-theatre-js)
- [API Reference – Theatre.js](#api-reference-theatre-js)
- [Prop types – Theatre.js](#prop-types-theatre-js)
- [Extensions – Theatre.js](#extensions-theatre-js)
- [Manual – Theatre.js](#manual-theatre-js)
- [@theatre/dataverse – Theatre.js](#-theatre-dataverse-theatre-js)
- [Advanced uses – Theatre.js](#advanced-uses-theatre-js)
- [Assets – Theatre.js](#assets-theatre-js)
- [Working with Sequences – Theatre.js](#working-with-sequences-theatre-js)
- [@theatre/dataverse – Theatre.js](#-theatre-dataverse-theatre-js)
- [API Reference – Theatre.js](#api-reference-theatre-js)
- [@theatre/studio – Theatre.js](#-theatre-studio-theatre-js)
- [Using Audio – Theatre.js](#using-audio-theatre-js)
- [@theatre/react – Theatre.js](#-theatre-react-theatre-js)
- [React Three Fiber – Theatre.js](#react-three-fiber-theatre-js)
- [React Three Fiber – Theatre.js](#react-three-fiber-theatre-js)
- [Advanced uses – Theatre.js](#advanced-uses-theatre-js)
- [Authoring extensions – Theatre.js](#authoring-extensions-theatre-js)
- [theatric – Theatre.js](#theatric-theatre-js)
- [@theatre/r3f – Theatre.js](#-theatre-r3f-theatre-js)
- [@theatre/r3f – Theatre.js](#-theatre-r3f-theatre-js)
- [@theatre/studio – Theatre.js](#-theatre-studio-theatre-js)
- [Authoring extensions – Theatre.js](#authoring-extensions-theatre-js)
- [theatric – Theatre.js](#theatric-theatre-js)
- [@theatre/core – Theatre.js](#-theatre-core-theatre-js)
- [@theatre/core – Theatre.js](#-theatre-core-theatre-js)
---
# Overview – Theatre.js
* Overview
Welcome to the Theatre.js documentation. Pick a [Getting started guide](https://www.theatrejs.com/docs/latest/getting-started)
or check out the [Documentation pages](https://www.theatrejs.com/docs/latest#documentation)
for more in-depth knowledge. Want to get in touch? See all the ways you can do it [here](https://www.theatrejs.com/docs/latest#community)
.
* * *
#Getting started
----------------
Theatre.js works with any front-end library or framework, but we've prepared some articles that make it easy to get started alongside some commonly used frameworks.
* [With React Three Fiber](https://www.theatrejs.com/docs/latest/getting-started/with-react-three-fiber)
* [With THREE.js](https://www.theatrejs.com/docs/latest/getting-started/with-three-js)
* [With HTML/SVG](https://www.theatrejs.com/docs/latest/getting-started/with-html-svg)
#Documentation
--------------
### Concepts
Learn the concepts behind animating with Theatre.js before you get started.
[Learn concepts](https://www.theatrejs.com/docs/latest/concepts)
### Releases
Take a look at the latest Theatre.js releases containing features and bug fixes.
[View releases](https://www.theatrejs.com/docs/latest/releases)
### Manual
Learn about animating in sync with audio, keyboard shortcuts, extensions, and more...
[View all manual articles](https://www.theatrejs.com/docs/latest/manual)
### API Reference
Learn the power of hacking with the Theatre.js animation tools in code.
[Read](https://www.theatrejs.com/docs/latest/api)
* * *
#Community
----------
### Twitter
Gifs, updates, and more on the Theatre.js twitter @theatre\_js
[Go to Twitter](https://twitter.com/theatre_js)
### Discord
Join the discord community and get help, give feedback, or show off what you've made!
[Join Discord](https://discord.gg/bm9f8F9Y9N)
### GitHub
Follow along with the development of Theatre.js and contribute on GitHub.
[Go to Repo](https://github.com/theatre-js/theatre)
Or, you can send us an email at [hello@theatrejs.com](mailto:hello@theatrejs.com)
.
* * *
Was this article helpful to you?
😫😕😀🤩
Last edited on February 01, 2024.
[Edit this page](https://github.com/theatre-js/website/blob/main/content/docs/0.5/index.mdx)
#### On this page
* [Getting started](https://www.theatrejs.com/docs/latest#getting-started)
* [Documentation](https://www.theatrejs.com/docs/latest#documentation)
* [Community](https://www.theatrejs.com/docs/latest#community)
[Theatre.js](https://www.theatrejs.com/)
Theatre.js is a design tool in the making. We aim to blur the line between designer/developer, author/consumer, and artist/scientist.
#### Get started with
* [React Three Fiber](https://www.theatrejs.com/docs/0.5/getting-started/with-react-three-fiber)
* [THREE.js](https://www.theatrejs.com/docs/0.5/getting-started/with-three-js)
* [HTML/CSS/SVG](https://www.theatrejs.com/docs/0.5/getting-started/with-html-svg)
#### Docs
* [Overview](https://www.theatrejs.com/docs/0.5)
* [Concepts](https://www.theatrejs.com/docs/0.5/concepts)
* [Getting started](https://www.theatrejs.com/docs/0.5/getting-started)
* [Manual](https://www.theatrejs.com/docs/0.5/manual)
* [API](https://www.theatrejs.com/docs/0.5/api)
#### Community
* [Twitter](https://twitter.com/theatre_js)
* [Discord](https://discord.gg/bm9f8F9Y9N)
* [GitHub](https://github.com/theatre-js/theatre)
#### Company
* [Jobs](https://www.theatrejs.com/join)
* [Blog](https://blog.theatrejs.com/)
* [Contact](mailto:hello@theatrejs.com)
© 2022 Theatre.js Oy – Helsinki.
---
# Overview – Theatre.js
* Overview
Welcome to the Theatre.js documentation. Pick a [Getting started guide](https://www.theatrejs.com/docs/latest/getting-started)
or check out the [Documentation pages](https://www.theatrejs.com/docs/0.5#documentation)
for more in-depth knowledge. Want to get in touch? See all the ways you can do it [here](https://www.theatrejs.com/docs/0.5#community)
.
* * *
#Getting started
----------------
Theatre.js works with any front-end library or framework, but we've prepared some articles that make it easy to get started alongside some commonly used frameworks.
* [With React Three Fiber](https://www.theatrejs.com/docs/latest/getting-started/with-react-three-fiber)
* [With THREE.js](https://www.theatrejs.com/docs/latest/getting-started/with-three-js)
* [With HTML/SVG](https://www.theatrejs.com/docs/latest/getting-started/with-html-svg)
#Documentation
--------------
### Concepts
Learn the concepts behind animating with Theatre.js before you get started.
[Learn concepts](https://www.theatrejs.com/docs/latest/concepts)
### Releases
Take a look at the latest Theatre.js releases containing features and bug fixes.
[View releases](https://www.theatrejs.com/docs/latest/releases)
### Manual
Learn about animating in sync with audio, keyboard shortcuts, extensions, and more...
[View all manual articles](https://www.theatrejs.com/docs/latest/manual)
### API Reference
Learn the power of hacking with the Theatre.js animation tools in code.
[Read](https://www.theatrejs.com/docs/latest/api)
* * *
#Community
----------
### Twitter
Gifs, updates, and more on the Theatre.js twitter @theatre\_js
[Go to Twitter](https://twitter.com/theatre_js)
### Discord
Join the discord community and get help, give feedback, or show off what you've made!
[Join Discord](https://discord.gg/bm9f8F9Y9N)
### GitHub
Follow along with the development of Theatre.js and contribute on GitHub.
[Go to Repo](https://github.com/theatre-js/theatre)
Or, you can send us an email at [hello@theatrejs.com](mailto:hello@theatrejs.com)
.
* * *
Was this article helpful to you?
😫😕😀🤩
Last edited on February 01, 2024.
[Edit this page](https://github.com/theatre-js/website/blob/main/content/docs/0.5/index.mdx)
#### On this page
* [Getting started](https://www.theatrejs.com/docs/0.5#getting-started)
* [Documentation](https://www.theatrejs.com/docs/0.5#documentation)
* [Community](https://www.theatrejs.com/docs/0.5#community)
[Theatre.js](https://www.theatrejs.com/)
Theatre.js is a design tool in the making. We aim to blur the line between designer/developer, author/consumer, and artist/scientist.
#### Get started with
* [React Three Fiber](https://www.theatrejs.com/docs/0.5/getting-started/with-react-three-fiber)
* [THREE.js](https://www.theatrejs.com/docs/0.5/getting-started/with-three-js)
* [HTML/CSS/SVG](https://www.theatrejs.com/docs/0.5/getting-started/with-html-svg)
#### Docs
* [Overview](https://www.theatrejs.com/docs/0.5)
* [Concepts](https://www.theatrejs.com/docs/0.5/concepts)
* [Getting started](https://www.theatrejs.com/docs/0.5/getting-started)
* [Manual](https://www.theatrejs.com/docs/0.5/manual)
* [API](https://www.theatrejs.com/docs/0.5/api)
#### Community
* [Twitter](https://twitter.com/theatre_js)
* [Discord](https://discord.gg/bm9f8F9Y9N)
* [GitHub](https://github.com/theatre-js/theatre)
#### Company
* [Jobs](https://www.theatrejs.com/join)
* [Blog](https://blog.theatrejs.com/)
* [Contact](mailto:hello@theatrejs.com)
© 2022 Theatre.js Oy – Helsinki.
---
# With THREE.js – Theatre.js
* [Theatre.js Docs](https://www.theatrejs.com/docs/0.5)
* [Getting started](https://www.theatrejs.com/docs/0.5/getting-started)
* With THREE.js
In this guide, you'll learn how to animate a 3D scene by integrating Theatre.js into a [THREE.js](https://threejs.org/)
project. Theatre.js can be used with THREE.js to animate things like the camera, lights, material colors, and more.
#Prerequisites
--------------
We'll start by cloning or downloading the code in the [THREE.js + bundler project repository](https://github.com/fulopkovacs/vanilla-threejs-project)
.
` # using git git clone https://github.com/fulopkovacs/vanilla-threejs-project `
Alternatively, you can download [the ZIP archive of the code](https://github.com/fulopkovacs/vanilla-threejs-project/archive/refs/heads/main.zip)
and extract it to a folder of your choice.
This code will set up a basic THREE.js scene with a torus know geometry, basic lighting, and a render loop.
This project uses Vite, but you really just need a basic web project set up with a bundler of your choice with some code to set up a [basic THREE.js scene](https://threejs.org/docs/#manual/en/introduction/Creating-a-scene)
.
Once you have your project cloned, navigate to the project folder in your terminal.
` # open the repository in your terminal cd vanilla-threejs-project `
And use a package manager of your choice (e.g., npm or yarn) to install dependencies to the `./node_modules` folder.
` # install the dependencies: npm install # and start the dev server: npm run dev `
Or with yarn:
` # install the dependencies: yarn install # and start the dev server: yarn run dev `
Now, if you open [`http://localhost:3000`](http://localhost:3000/)
in the browser, you should see something like this:

#Add Theatre.js packages
------------------------
Now that you have a THREE.js codebase you want to add Theatre.js to, let's install Theatre.js's packages.
` # with npm npm install --save @theatre/core @theatre/studio # or with yarn yarn add @theatre/core @theatre/studio `
#Create an animation
--------------------
Theatre.js has two essential packages that we need to use in this project. `@theatre/studio` is the editor GUI that we use to create animations, and `@theatre/core` plays the animations we've created. If you're using the started project, naviage to the `main.ts` file and let's import the studio package and initialize the editor:
` /* ... */ import * as THREE from 'three' import studio from '@theatre/studio' /** * Theatre.js */ studio.initialize() /* ... */ `

#Animate the rotation of the TorusKnot
--------------------------------------
So far, we cannot edit anything using the UI; we need to hook up our THREE.js objects to Theatre.js first. There are a lot of things we could animate in the starting scene, but let's focus on the rotation of the `torusKnot` for now.
First, create a Theatre.js project using the code below. A [Project](https://www.theatrejs.com/docs/latest/manual/projects)
in Theatre.js is like a save file. Projects are stored in the browser's `localStorage`, so you don't lose your progress if you close and reopen Theatre.js.
` import * as THREE from 'three' import { getProject } from '@theatre/core' // Initialize the studio studio.initialize() // Create a project for the animation const project = getProject('THREE.js x Theatre.js') `
Now we'll add a [Sheet](https://www.theatrejs.com/docs/latest/manual/sheets)
. Sheets are a collection of objects which can be animated together.
` /* ... */ // Create a project for the animation const project = getProject('THREE.js x Theatre.js') // Create a sheet const sheet = project.sheet('Animated scene') `
Next, we'll create a [Sheet Object](https://www.theatrejs.com/docs/latest/manual/objects)
with the [props](https://www.theatrejs.com/docs/latest/manual/prop-types)
that you want to animate. Sheets contain one or more objects, that can be animated together. You can customize how these props look and behave in the UI, e.g. you can set minimum and maximum values of a number prop by modifying its `range`.
` import * as THREE from 'three' import { getProject, types } from '@theatre/core' /* ... */ scene.add(mesh) // Create a Theatre.js object with the props you want to // animate const torusKnotObj = sheet.object('Torus Knot', { // Note that the rotation is in radians // (full rotation: 2 * Math.PI) rotation: types.compound({ x: types.number(mesh.rotation.x, { range: [-2, 2] }), y: types.number(mesh.rotation.y, { range: [-2, 2] }), z: types.number(mesh.rotation.z, { range: [-2, 2] }), }), }) `
The last thing to do is to rotate the torusKnot's mesh based on the values of `torusKnotObj`. This can be done by listening to the changes of the `torusKnotObj` and updating the rotation of the `torusKnot`.
` const torusKnotObj = sheet.object('Torus Knot', { /* ... */ }) torusKnotObj.onValuesChange((values) => { const { x, y, z } = values.rotation mesh.rotation.set(x * Math.PI, y * Math.PI, z * Math.PI) }) `
Now you're set up to use the [Studio](https://www.theatrejs.com/docs/latest/manual/Studio)
to edit and animate the torusKnot's rotation!
#Animating objects
------------------
To start animating, we first have to sequence the properties of an object we want to animate. To sequence properties: select an object, right-click on a property (or group of properties) in the property editor panel, and click "sequence". After clicking "sequence", the sequence editor will open. Here, we'll sequence the rotation of the torus knot.
Sequencing props
To animate the knot's rotation, we'll create two sets of keyframes by clicking on the yellow diamond next to the rotation prop in the [Details Panel](https://www.theatrejs.com/docs/latest/manual/Studio#details-panel)
, one with the playhead at `0s`, and one at `3s`. We'll then set the first set of keyframes to `0`, and the second set to `1`.
Animating props
You can of course experiment with adding more keyframes.
Once we have some keyframes in the sequence editor, we can play our animation by pressing `Space`.
Tip: If the Studio UI gets in the way, you can hide it by pressing `Alt/Option + \`.
To learn more about creating animations, see [Working with Sequences](https://www.theatrejs.com/docs/latest/manual/sequences)
.

#Getting ready for production
-----------------------------
All the keyframes you created are saved in your browser's `localStorage` so that your animation will be remembered between page refreshes. However, now you may want a way to save, share/publish, and programmatically play your animation.
To distribute your animation as a part of your website, export your Theatre.js Project by clicking on "THREE.js x Theatre.js" in the outline menu in the top left of the UI.

Then click on the "Export THREE.js x Theatre.js to JSON" button on the right.

This will download a JSON file `state.json`. Now, we can move `state.json` to the folder containing our web project, and import the JSON file:
` import projectState from './state.json' `
Then replace our code from before:
` const project = getProject('THREE.js x Theatre.js') `
With this code:
` const project = getProject('THREE.js x Theatre.js', { state: projectState }) `
We are now passing the saved animation state to [getProject](https://www.theatrejs.com/docs/latest/api/core#getproject)
. By doing this,the Theatre.js project will be initialized with the saved animation from `state.json` instead of the animation saved in `localStorage`. Don't worry; any changes you make to your animation in Studio will still be saved to `localStorage` after you do this (your edits will still survive page refreshes).
The last thing left is programmatically playing your animation.
To play an animation, we need to get a reference to its [sequence](https://www.theatrejs.com/docs/latest/concepts#sequences)
and call the [play](https://www.theatrejs.com/docs/latest/api/core#sequence.play)
method on it. [Sequence.play](https://www.theatrejs.com/docs/latest/api/core#sequence.play)
accepts a number of options. Here, we are going to instruct Theatre.js to play the animation forever.
` // Play the animation on repeat project.ready.then(() => sheet.sequence.play({ iterationCount: Infinity })) `
In summary, your code will now look like the following [GitHub repo](https://github.com/fulopkovacs/threejs-x-theatrejs)
.
To check what our page looks like without the Studio, we can press `Alt/Option + \` to hide it. Alternatively, we can comment out `studio.initialize()`.
#Deploying to production
------------------------
When we are done and ready to deploy our webpage to production, we only need to do two things.
1. Make sure that we have the latest project state exported to a JSON file and passed to [getProject](https://www.theatrejs.com/docs/latest/api/core#getproject)
.
2. Remove [studio.initialize](https://www.theatrejs.com/docs/latest/api/studio#studio.initialize)
and [studio.extend](https://www.theatrejs.com/docs/latest/api/studio#studio.extend)
.
We can also achieve the last step without manually editing the code every time by using environment-checks and relying on our bundler's tree-shaking feature:
` // Vite if (import.meta.env.DEV) { studio.initialize() studio.extend(extension) } `
` // create-react-app if (process.env.NODE_ENV === 'development') { studio.initialize() studio.extend(extension) } `
#Next steps
-----------
Want to learn more? Take a look at some more in-depth topics from [our manual](https://www.theatrejs.com/docs/latest/manual)
:
### Projects
This guide covers creating projects, managing their states, saving and loading their states, and more.
### Sheets
This guide covers Sheets in Theatre.js
### Sheet Objects
This guide covers Sheet Objects in Theatre.js.
### Prop types
Learn how to customize the props you want to animate with Theatre.js. When creating a Sheet Object, we define the props that we want to animate on it. Props can have different types which can be imported from "@theatre/core".
### Working with Sequences
In this guide, we'll explore the tools that Theatre.js offers for creating animations.
### Assets
Learn about assets in Theatre.js
### Using Audio
Learn how to load and synchronize music or narration audio to an animation.
### Studio
Learn the different parts of the Studio.
### Authoring extensions
The Theatre.js Studio API enables you to define extensions that extend the Studio's UI and/or extend the functionality of Studio.
### Keyboard & Mouse Controls
A catalog of controls in Theatre.js Studio.
### Advanced uses
Or check out another getting started guide:
### With React Three Fiber
Animate a React Three Fiber project using Theatre.js's r3f extension, "@theatre/r3f". This guide assumes that you have a web project with a bundler set up.
### With HTML/SVG
How to get started animating HTML elements directly with Theatre.js. This tutorial doesn't require any knowledge beyond HTML + JavaScript.
* * *
Was this article helpful to you?
😫😕😀🤩
Last edited on February 01, 2024.
[Edit this page](https://github.com/theatre-js/website/blob/main/content/docs/0.5/100-getting-started/200-with-three-js.mdx)
#### On this page
* [Prerequisites](https://www.theatrejs.com/docs/0.5/getting-started/with-three-js#prerequisites)
* [Add Theatre.js packages](https://www.theatrejs.com/docs/0.5/getting-started/with-three-js#add-theatre.js-packages)
* [Create an animation](https://www.theatrejs.com/docs/0.5/getting-started/with-three-js#create-an-animation)
* [Animate the rotation of the TorusKnot](https://www.theatrejs.com/docs/0.5/getting-started/with-three-js#animate-the-rotation-of-the-torusknot)
* [Animating objects](https://www.theatrejs.com/docs/0.5/getting-started/with-three-js#animating-objects)
* [Getting ready for production](https://www.theatrejs.com/docs/0.5/getting-started/with-three-js#getting-ready-for-production)
* [Deploying to production](https://www.theatrejs.com/docs/0.5/getting-started/with-three-js#deploying-to-production)
* [Next steps](https://www.theatrejs.com/docs/0.5/getting-started/with-three-js#next-steps)
[Theatre.js](https://www.theatrejs.com/)
Theatre.js is a design tool in the making. We aim to blur the line between designer/developer, author/consumer, and artist/scientist.
#### Get started with
* [React Three Fiber](https://www.theatrejs.com/docs/0.5/getting-started/with-react-three-fiber)
* [THREE.js](https://www.theatrejs.com/docs/0.5/getting-started/with-three-js)
* [HTML/CSS/SVG](https://www.theatrejs.com/docs/0.5/getting-started/with-html-svg)
#### Docs
* [Overview](https://www.theatrejs.com/docs/0.5)
* [Concepts](https://www.theatrejs.com/docs/0.5/concepts)
* [Getting started](https://www.theatrejs.com/docs/0.5/getting-started)
* [Manual](https://www.theatrejs.com/docs/0.5/manual)
* [API](https://www.theatrejs.com/docs/0.5/api)
#### Community
* [Twitter](https://twitter.com/theatre_js)
* [Discord](https://discord.gg/bm9f8F9Y9N)
* [GitHub](https://github.com/theatre-js/theatre)
#### Company
* [Jobs](https://www.theatrejs.com/join)
* [Blog](https://blog.theatrejs.com/)
* [Contact](mailto:hello@theatrejs.com)
© 2022 Theatre.js Oy – Helsinki.
---
# Releases – Theatre.js
* [Theatre.js Docs](https://www.theatrejs.com/docs/latest)
* Releases
#v0.7.0
-------
This is the latest version of Theatre.js. Upgrade by running `npm install @theatre/core@latest @theatre/studio@latest @theatre/r3f@latest` in your project.
_August 10th 2023_
* **New features**
* [`@theatre/r3f`](https://www.theatrejs.com/docs/latest/extensions/react-three-fiber)
now supports THREE.js r155.
* [Assets](https://www.theatrejs.com/docs/latest/manual/assets)
[now](https://github.com/theatre-js/theatre/pull/408)
support the file type, so any file can be used as an asset, by [João Leite](https://github.com/joaogsleite)
.
* [`@theatre/dataverse`](https://github.com/theatre-js/theatre/blob/main/packages/dataverse)
and [`@theatre/react`](https://github.com/theatre-js/theatre/blob/main/packages/react)
are now marked as stable and can be used outside of Theatre.js.
* [Extensions](https://www.theatrejs.com/docs/latest/manual/authoring-extensions)
are now hot-reloadable.
* **Breaking changes**
* [`@theatre/r3f`](https://www.theatrejs.com/docs/latest/extensions/react-three-fiber)
: The r3f extension now requires `three` at `>=0.155.0` and `@react-three/fiber` at `>=8.13.6`.
* [`@theatre/react`](https://github.com/theatre-js/theatre/blob/main/packages/react)
: The `usePrismWithoutReRender()` and `usePrismInstanceWithoutReRender()` have been removed.
* **Bug fixes**
* [`@theatre/react`](https://github.com/theatre-js/theatre/blob/main/packages/react)
is now hot-reloadable.
* **Internal changes**
* Theatre.js now uses React 18 under the hood.
* The playground is now hot-reloadable.
* New visual regression tests.
* Compat fixtures now test Theatre.js with Vite, Next.js, React 18, React 17, and other popular JS tools.
#v0.6.2
-------
_July 24th 2023_
* This update includes:
* [A fix](https://github.com/theatre-js/theatre/pull/433)
for the compatibility issue with THREE.js r154, by [Colin Duffy](https://twitter.com/tomorrowevening)
.
* You can now read the keyframes of a prop by calling [`sequence.__experimental_getKeyframes()`](https://www.theatrejs.com/docs/latest/api/core#sequence.__experimental_getkeyframes_pointer_)
, [implemented](https://github.com/theatre-js/theatre/pull/426)
by [Adam Krebs](https://github.com/akre54)
.
* It is [now](https://github.com/theatre-js/theatre/pull/425)
easier to sequence props by just clicking on their control indicator.
#v0.6.1
-------
_May 12th 2023_
* This update includes:
* [Added](https://github.com/theatre-js/theatre/commit/4d7373e1a9b4263923c0923d0e48976db65a10be)
support for typescript's bundle mode to `@theatre/r3f`.
* [Implemented](https://github.com/theatre-js/theatre/pull/391)
the experimental `createContentOfSaveFileTyped()`, by [Adam Krebs](https://github.com/akre54)
.
* A small UX [improvement](https://github.com/theatre-js/theatre/commit/6c7da6f653b452f1ce9d2995eae65606703598ab)
for PlayheadPositionPopover.
* An [experimental API](https://github.com/theatre-js/theatre/pull/393)
for forgetting sheets and objects.
* [Implemented](https://github.com/theatre-js/theatre/pull/142)
a method to clear the persistent storage.
* A substantial perf improvement for `@theatre/studio`.
* The default and static overrides are now [distinguisable](https://github.com/theatre-js/theatre/commit/6f8e91ed5f6ed34a527553ec4c04b9e5b8316524)
in the UI.
* A [temporary](https://github.com/theatre-js/theatre/pull/386)
API for enabling/disabling triggering playback via the spacebar.
* And several UX improvements.
#v0.6.0
-------
_Jan 25th 2023_
* **New features**
* [Theatric](https://github.com/theatre-js/theatre/tree/main/packages/theatric)
is a new controller library bulit on Theatre.js for tweaking and fine-tuning variables in your app.
* [Assets](https://www.theatrejs.com/docs/latest/manual/assets)
allow you to use files as values for props and even keyframes.
* [`rafDriver`](https://www.theatrejs.com/docs/latest/manual/advanced#rafdrivers)
s allow you to control when and how often computations in Theatre tick forward, [based](https://github.com/theatre-js/theatre/commit/d6498585295962c55a6d412e74ad7f65af86adb7)
on work by [Pete Feltham](https://github.com/felthy)
.
* Items in the outline menu are now [collapsible](https://github.com/theatre-js/theatre/pull/367)
, based on work by [Clément Roche](https://github.com/clementroche)
.
* A new easing option called "[Hold](https://github.com/theatre-js/theatre/pull/360)
", courtesy of [Colin Duffy](https://twitter.com/tomorrowevening)
.
* Number props have a [more predictable](https://github.com/theatre-js/theatre/issues/314)
nudging behavior.
* Compound props that represent vectors (such as `{x, y, z}`) now take up less space by collapsing into a single row.
* Markers in the sequence editor can now [have their own labels](https://github.com/theatre-js/theatre/pull/362)
, by [Colin Duffy](https://twitter.com/tomorrowevening)
.
* Extensions can now contribute [flyout menus](https://github.com/theatre-js/theatre/pull/379)
to the studio, by [Colin Duffy](https://twitter.com/tomorrowevening)
.
* Other notable changes
* Much simpler dataflow and faster internals via major changes to [dataverse](https://github.com/theatre-js/theatre/pull/345)
.
* Components in an object key [can now](https://github.com/theatre-js/theatre/pull/376)
be 64 characters long, by [AD2018](https://github.com/AD2018)
.
* Dynamic object properties are reflected in the UI [more efficiently](https://github.com/theatre-js/theatre/commit/c58bc694ee8dc45395336ff9add70b99d0dbaf3a)
, thanks to [@mmiinnovations](https://github.com/mmiinnovations)
.
#v0.5.1
-------
_December 31st 2022_
* **New features**
* A new [Camera](https://www.theatrejs.com/docs/0.5/api/r3f#cameras)
implementation with a convenient `lookAt` target.
* You can now dynamically remove objects via [`Sheet.detatchObject()`](https://www.theatrejs.com/docs/latest/manual/objects#detatching-objects)
.
* Objects can now be reconfigured on the fly via the [`reconfigure` option](https://www.theatrejs.com/docs/latest/manual/objects#reconfiguring-existing-objects)
.
* `@theatre/r3f` now supports hot reloading.
* A new in-app guide [helps](https://github.com/theatre-js/theatre/pull/320)
you avoid common mistakes.
* [Out-of-the-box support](https://github.com/theatre-js/theatre/pull/316)
for all THREE.js light types.
* Support for server-side rendering in Next.js and other SSR frameworks.
* **Bug fixes**
* [Fixed a bug](https://github.com/theatre-js/theatre/pull/344)
that caused only a single project to be export-able per reload.
* [Fixed an edge-case](https://github.com/theatre-js/theatre/pull/340)
where inline keyframe values might remain stale after an edit.
* [Fixed an edge-case](https://github.com/theatre-js/theatre/pull/309)
where some panes would get dragged out of the browser window.
* [Fixed a bug](https://github.com/theatre-js/theatre/commit/27ef3cc1c9dfcca8d06bd53c5a7185f20c853114)
that prevented audio playback in the studio.
#v0.5
-----
_September 14th 2022_
Theatre.js **v0.5** · Introduces a 3D editor for React Three Fiber, complex keyframing tools, and an extensions API. [More in the blog post](https://www.theatrejs.com/blog/theatre-05-is-out)
.
* [Prop types](https://www.theatrejs.com/docs/latest/manual/prop-types)
* All prop types are now [sequenceable](https://www.theatrejs.com/docs/latest/manual/sequences#sequencing-props)
* Prop types can optionally have [custom linear interpolators](https://www.theatrejs.com/docs/latest/api/core#docs-500-api-100-core-custom-interpolators)
* Added [color prop](https://www.theatrejs.com/docs/latest/manual/prop-types#types.rgba_initval_)
* [Numeric props](https://www.theatrejs.com/docs/latest/manual/prop-types#types.number_initval-options_)
can now be dragged with a pointer lock
* [Sequence editor](https://www.theatrejs.com/docs/latest/manual/sequences)
* [Keyframe values can now be edited inline](https://www.theatrejs.com/docs/latest/manual/sequences#editing-keyframe-values-in-the-inline-editor)
* [Single easing editor, with easing presets and fuzzy search](https://www.theatrejs.com/docs/latest/manual/sequences#using-the-tween-editor)
* [Aggregate keyframe tracks](https://www.theatrejs.com/docs/latest/manual/sequences#aggregate-keyframes)
* Markers
* [Focus range](https://www.theatrejs.com/docs/latest/manual/sequences#focus-range)
* Several UX improvements with the scroll/pinch gestures ([Keyboard controls](https://www.theatrejs.com/docs/latest/manual/keyboard-shortcuts)
)
* [Selections](https://www.theatrejs.com/docs/latest/manual/sequences#selections)
* [Copy/paste](https://www.theatrejs.com/docs/latest/manual/sequences#copyingpasting-keyframes)
* Workspaces
* An update checker that shows a badge if there is a new version of Theatre.js available
* It is possible now to [nest/namespace objects](https://www.theatrejs.com/docs/latest/manual/objects#namespacing-objects)
* The outline menu's items are now sorted alphabetically
* The left/right panels can now auto-hide or be pinned
* Better support for windows
* Fixed compatibility with the rest of the JS ecosystem - now bundles all of its dependencies, allowing you to use it with any version of React, Vue.js, Svelte, and of course, vanilla JS.
* Performance improvements
* New helpful warnings in the API
* `@theatre/core`
* [Audio playback](https://www.theatrejs.com/docs/latest/manual/audio)
* Added [an API for reading/observing the position of the seeker in the sequence, its length, and its playback state](https://www.theatrejs.com/docs/latest/api/core#sequence.pointer-api)
* You can now [export the state of each project programmatically](https://www.theatrejs.com/docs/latest/api/studio#studio.createcontentofsavefile-fn)
* First release of [`@theatre/r3f`](https://www.npmjs.com/package/@theatre/r3f)
(read the ["Getting started with React Three Fiber"](https://www.theatrejs.com/docs/latest/getting-started/with-react-three-fiber)
guide for an introduction to the library, or check the [API docs](https://www.theatrejs.com/docs/latest/api/r3f)
to dive deeper)
* * *
Was this article helpful to you?
😫😕😀🤩
Last edited on February 01, 2024.
[Edit this page](https://github.com/theatre-js/website/blob/main/content/docs/0.5/030-releases/index.mdx)
#### On this page
* [v0.7.0](https://www.theatrejs.com/docs/latest/releases#v0.7.0)
* [v0.6.2](https://www.theatrejs.com/docs/latest/releases#v0.6.2)
* [v0.6.1](https://www.theatrejs.com/docs/latest/releases#v0.6.1)
* [v0.6.0](https://www.theatrejs.com/docs/latest/releases#v0.6.0)
* [v0.5.1](https://www.theatrejs.com/docs/latest/releases#v0.5.1)
* [v0.5](https://www.theatrejs.com/docs/latest/releases#v0.5)
[Theatre.js](https://www.theatrejs.com/)
Theatre.js is a design tool in the making. We aim to blur the line between designer/developer, author/consumer, and artist/scientist.
#### Get started with
* [React Three Fiber](https://www.theatrejs.com/docs/0.5/getting-started/with-react-three-fiber)
* [THREE.js](https://www.theatrejs.com/docs/0.5/getting-started/with-three-js)
* [HTML/CSS/SVG](https://www.theatrejs.com/docs/0.5/getting-started/with-html-svg)
#### Docs
* [Overview](https://www.theatrejs.com/docs/0.5)
* [Concepts](https://www.theatrejs.com/docs/0.5/concepts)
* [Getting started](https://www.theatrejs.com/docs/0.5/getting-started)
* [Manual](https://www.theatrejs.com/docs/0.5/manual)
* [API](https://www.theatrejs.com/docs/0.5/api)
#### Community
* [Twitter](https://twitter.com/theatre_js)
* [Discord](https://discord.gg/bm9f8F9Y9N)
* [GitHub](https://github.com/theatre-js/theatre)
#### Company
* [Jobs](https://www.theatrejs.com/join)
* [Blog](https://blog.theatrejs.com/)
* [Contact](mailto:hello@theatrejs.com)
© 2022 Theatre.js Oy – Helsinki.
---
# Concepts – Theatre.js
* [Theatre.js Docs](https://www.theatrejs.com/docs/0.5)
* Concepts
#Objects
--------
An animated illustration of Theatre.js objects. Side-by-side animations of a jumping cube and button.
**Everything that is animated** is represented as an object. Objects can be THREE.js objects or virtual objects that don't exist on the screen.
#Props
------
**Objects are made up of props.** Each prop can have a different type and can be sequenced.

### #Changing props
Props can be changed via Theatre's UI or via code.
A video of the Theatre.js UI with a cube on the webpage. Shows the mouse moving the cube up and down using the grabbable axis in the 3D editor and shows the user changing the y value of the cube in the UI.
#Sheets
-------
Sheets **contain one or more objects** that can be animated together.
An animated illustration of Theatre.js sheets. Shows a cube jumping (obj1) and some dust particles (obj2).
### #Sheet instances
An animated illustration of Theatre.js sheet instances. Shows three identical animations of a cube jumping with offset animation start times.
You can **re-use a sheet by making instances** of it. That means we can have more than one jumpidy-jump animation, each with its own little box and dust particles.
### #Sequences
An animated illustration of Theatre.js sequences. Shows a cube jumping animations with the Theatre.js Studio "dope sheet" panel below. The dope sheet panel contains a moving playhead and visual representations of props with tracks containing keyframes and tweens.
Each sheet has a single sequence _(multi-sequence sheets are in the works!)_. A sequence is basically made up of **all of the keyframes of all of the objects in a sheet**.
#Extensions
-----------

**Extensions can make creating and editing objects for your animation much easier**. They can provide editor gizmos, toolbars, and even their own panes.
* * *
Was this article helpful to you?
😫😕😀🤩
Last edited on February 01, 2024.
[Edit this page](https://github.com/theatre-js/website/blob/main/content/docs/0.5/020-concepts/index.mdx)
#### On this page
* [Objects](https://www.theatrejs.com/docs/0.5/concepts#objects)
* [Props](https://www.theatrejs.com/docs/0.5/concepts#props)
* [Changing props](https://www.theatrejs.com/docs/0.5/concepts#changing-props)
* [Sheets](https://www.theatrejs.com/docs/0.5/concepts#sheets)
* [Sheet instances](https://www.theatrejs.com/docs/0.5/concepts#sheet-instances)
* [Sequences](https://www.theatrejs.com/docs/0.5/concepts#sequences)
* [Extensions](https://www.theatrejs.com/docs/0.5/concepts#extensions)
[Theatre.js](https://www.theatrejs.com/)
Theatre.js is a design tool in the making. We aim to blur the line between designer/developer, author/consumer, and artist/scientist.
#### Get started with
* [React Three Fiber](https://www.theatrejs.com/docs/0.5/getting-started/with-react-three-fiber)
* [THREE.js](https://www.theatrejs.com/docs/0.5/getting-started/with-three-js)
* [HTML/CSS/SVG](https://www.theatrejs.com/docs/0.5/getting-started/with-html-svg)
#### Docs
* [Overview](https://www.theatrejs.com/docs/0.5)
* [Concepts](https://www.theatrejs.com/docs/0.5/concepts)
* [Getting started](https://www.theatrejs.com/docs/0.5/getting-started)
* [Manual](https://www.theatrejs.com/docs/0.5/manual)
* [API](https://www.theatrejs.com/docs/0.5/api)
#### Community
* [Twitter](https://twitter.com/theatre_js)
* [Discord](https://discord.gg/bm9f8F9Y9N)
* [GitHub](https://github.com/theatre-js/theatre)
#### Company
* [Jobs](https://www.theatrejs.com/join)
* [Blog](https://blog.theatrejs.com/)
* [Contact](mailto:hello@theatrejs.com)
© 2022 Theatre.js Oy – Helsinki.
---
# Releases – Theatre.js
* [Theatre.js Docs](https://www.theatrejs.com/docs/0.5)
* Releases
#v0.7.0
-------
This is the latest version of Theatre.js. Upgrade by running `npm install @theatre/core@latest @theatre/studio@latest @theatre/r3f@latest` in your project.
_August 10th 2023_
* **New features**
* [`@theatre/r3f`](https://www.theatrejs.com/docs/latest/extensions/react-three-fiber)
now supports THREE.js r155.
* [Assets](https://www.theatrejs.com/docs/latest/manual/assets)
[now](https://github.com/theatre-js/theatre/pull/408)
support the file type, so any file can be used as an asset, by [João Leite](https://github.com/joaogsleite)
.
* [`@theatre/dataverse`](https://github.com/theatre-js/theatre/blob/main/packages/dataverse)
and [`@theatre/react`](https://github.com/theatre-js/theatre/blob/main/packages/react)
are now marked as stable and can be used outside of Theatre.js.
* [Extensions](https://www.theatrejs.com/docs/latest/manual/authoring-extensions)
are now hot-reloadable.
* **Breaking changes**
* [`@theatre/r3f`](https://www.theatrejs.com/docs/latest/extensions/react-three-fiber)
: The r3f extension now requires `three` at `>=0.155.0` and `@react-three/fiber` at `>=8.13.6`.
* [`@theatre/react`](https://github.com/theatre-js/theatre/blob/main/packages/react)
: The `usePrismWithoutReRender()` and `usePrismInstanceWithoutReRender()` have been removed.
* **Bug fixes**
* [`@theatre/react`](https://github.com/theatre-js/theatre/blob/main/packages/react)
is now hot-reloadable.
* **Internal changes**
* Theatre.js now uses React 18 under the hood.
* The playground is now hot-reloadable.
* New visual regression tests.
* Compat fixtures now test Theatre.js with Vite, Next.js, React 18, React 17, and other popular JS tools.
#v0.6.2
-------
_July 24th 2023_
* This update includes:
* [A fix](https://github.com/theatre-js/theatre/pull/433)
for the compatibility issue with THREE.js r154, by [Colin Duffy](https://twitter.com/tomorrowevening)
.
* You can now read the keyframes of a prop by calling [`sequence.__experimental_getKeyframes()`](https://www.theatrejs.com/docs/latest/api/core#sequence.__experimental_getkeyframes_pointer_)
, [implemented](https://github.com/theatre-js/theatre/pull/426)
by [Adam Krebs](https://github.com/akre54)
.
* It is [now](https://github.com/theatre-js/theatre/pull/425)
easier to sequence props by just clicking on their control indicator.
#v0.6.1
-------
_May 12th 2023_
* This update includes:
* [Added](https://github.com/theatre-js/theatre/commit/4d7373e1a9b4263923c0923d0e48976db65a10be)
support for typescript's bundle mode to `@theatre/r3f`.
* [Implemented](https://github.com/theatre-js/theatre/pull/391)
the experimental `createContentOfSaveFileTyped()`, by [Adam Krebs](https://github.com/akre54)
.
* A small UX [improvement](https://github.com/theatre-js/theatre/commit/6c7da6f653b452f1ce9d2995eae65606703598ab)
for PlayheadPositionPopover.
* An [experimental API](https://github.com/theatre-js/theatre/pull/393)
for forgetting sheets and objects.
* [Implemented](https://github.com/theatre-js/theatre/pull/142)
a method to clear the persistent storage.
* A substantial perf improvement for `@theatre/studio`.
* The default and static overrides are now [distinguisable](https://github.com/theatre-js/theatre/commit/6f8e91ed5f6ed34a527553ec4c04b9e5b8316524)
in the UI.
* A [temporary](https://github.com/theatre-js/theatre/pull/386)
API for enabling/disabling triggering playback via the spacebar.
* And several UX improvements.
#v0.6.0
-------
_Jan 25th 2023_
* **New features**
* [Theatric](https://github.com/theatre-js/theatre/tree/main/packages/theatric)
is a new controller library bulit on Theatre.js for tweaking and fine-tuning variables in your app.
* [Assets](https://www.theatrejs.com/docs/latest/manual/assets)
allow you to use files as values for props and even keyframes.
* [`rafDriver`](https://www.theatrejs.com/docs/latest/manual/advanced#rafdrivers)
s allow you to control when and how often computations in Theatre tick forward, [based](https://github.com/theatre-js/theatre/commit/d6498585295962c55a6d412e74ad7f65af86adb7)
on work by [Pete Feltham](https://github.com/felthy)
.
* Items in the outline menu are now [collapsible](https://github.com/theatre-js/theatre/pull/367)
, based on work by [Clément Roche](https://github.com/clementroche)
.
* A new easing option called "[Hold](https://github.com/theatre-js/theatre/pull/360)
", courtesy of [Colin Duffy](https://twitter.com/tomorrowevening)
.
* Number props have a [more predictable](https://github.com/theatre-js/theatre/issues/314)
nudging behavior.
* Compound props that represent vectors (such as `{x, y, z}`) now take up less space by collapsing into a single row.
* Markers in the sequence editor can now [have their own labels](https://github.com/theatre-js/theatre/pull/362)
, by [Colin Duffy](https://twitter.com/tomorrowevening)
.
* Extensions can now contribute [flyout menus](https://github.com/theatre-js/theatre/pull/379)
to the studio, by [Colin Duffy](https://twitter.com/tomorrowevening)
.
* Other notable changes
* Much simpler dataflow and faster internals via major changes to [dataverse](https://github.com/theatre-js/theatre/pull/345)
.
* Components in an object key [can now](https://github.com/theatre-js/theatre/pull/376)
be 64 characters long, by [AD2018](https://github.com/AD2018)
.
* Dynamic object properties are reflected in the UI [more efficiently](https://github.com/theatre-js/theatre/commit/c58bc694ee8dc45395336ff9add70b99d0dbaf3a)
, thanks to [@mmiinnovations](https://github.com/mmiinnovations)
.
#v0.5.1
-------
_December 31st 2022_
* **New features**
* A new [Camera](https://www.theatrejs.com/docs/0.5/api/r3f#cameras)
implementation with a convenient `lookAt` target.
* You can now dynamically remove objects via [`Sheet.detatchObject()`](https://www.theatrejs.com/docs/latest/manual/objects#detatching-objects)
.
* Objects can now be reconfigured on the fly via the [`reconfigure` option](https://www.theatrejs.com/docs/latest/manual/objects#reconfiguring-existing-objects)
.
* `@theatre/r3f` now supports hot reloading.
* A new in-app guide [helps](https://github.com/theatre-js/theatre/pull/320)
you avoid common mistakes.
* [Out-of-the-box support](https://github.com/theatre-js/theatre/pull/316)
for all THREE.js light types.
* Support for server-side rendering in Next.js and other SSR frameworks.
* **Bug fixes**
* [Fixed a bug](https://github.com/theatre-js/theatre/pull/344)
that caused only a single project to be export-able per reload.
* [Fixed an edge-case](https://github.com/theatre-js/theatre/pull/340)
where inline keyframe values might remain stale after an edit.
* [Fixed an edge-case](https://github.com/theatre-js/theatre/pull/309)
where some panes would get dragged out of the browser window.
* [Fixed a bug](https://github.com/theatre-js/theatre/commit/27ef3cc1c9dfcca8d06bd53c5a7185f20c853114)
that prevented audio playback in the studio.
#v0.5
-----
_September 14th 2022_
Theatre.js **v0.5** · Introduces a 3D editor for React Three Fiber, complex keyframing tools, and an extensions API. [More in the blog post](https://www.theatrejs.com/blog/theatre-05-is-out)
.
* [Prop types](https://www.theatrejs.com/docs/latest/manual/prop-types)
* All prop types are now [sequenceable](https://www.theatrejs.com/docs/latest/manual/sequences#sequencing-props)
* Prop types can optionally have [custom linear interpolators](https://www.theatrejs.com/docs/latest/api/core#docs-500-api-100-core-custom-interpolators)
* Added [color prop](https://www.theatrejs.com/docs/latest/manual/prop-types#types.rgba_initval_)
* [Numeric props](https://www.theatrejs.com/docs/latest/manual/prop-types#types.number_initval-options_)
can now be dragged with a pointer lock
* [Sequence editor](https://www.theatrejs.com/docs/latest/manual/sequences)
* [Keyframe values can now be edited inline](https://www.theatrejs.com/docs/latest/manual/sequences#editing-keyframe-values-in-the-inline-editor)
* [Single easing editor, with easing presets and fuzzy search](https://www.theatrejs.com/docs/latest/manual/sequences#using-the-tween-editor)
* [Aggregate keyframe tracks](https://www.theatrejs.com/docs/latest/manual/sequences#aggregate-keyframes)
* Markers
* [Focus range](https://www.theatrejs.com/docs/latest/manual/sequences#focus-range)
* Several UX improvements with the scroll/pinch gestures ([Keyboard controls](https://www.theatrejs.com/docs/latest/manual/keyboard-shortcuts)
)
* [Selections](https://www.theatrejs.com/docs/latest/manual/sequences#selections)
* [Copy/paste](https://www.theatrejs.com/docs/latest/manual/sequences#copyingpasting-keyframes)
* Workspaces
* An update checker that shows a badge if there is a new version of Theatre.js available
* It is possible now to [nest/namespace objects](https://www.theatrejs.com/docs/latest/manual/objects#namespacing-objects)
* The outline menu's items are now sorted alphabetically
* The left/right panels can now auto-hide or be pinned
* Better support for windows
* Fixed compatibility with the rest of the JS ecosystem - now bundles all of its dependencies, allowing you to use it with any version of React, Vue.js, Svelte, and of course, vanilla JS.
* Performance improvements
* New helpful warnings in the API
* `@theatre/core`
* [Audio playback](https://www.theatrejs.com/docs/latest/manual/audio)
* Added [an API for reading/observing the position of the seeker in the sequence, its length, and its playback state](https://www.theatrejs.com/docs/latest/api/core#sequence.pointer-api)
* You can now [export the state of each project programmatically](https://www.theatrejs.com/docs/latest/api/studio#studio.createcontentofsavefile-fn)
* First release of [`@theatre/r3f`](https://www.npmjs.com/package/@theatre/r3f)
(read the ["Getting started with React Three Fiber"](https://www.theatrejs.com/docs/latest/getting-started/with-react-three-fiber)
guide for an introduction to the library, or check the [API docs](https://www.theatrejs.com/docs/latest/api/r3f)
to dive deeper)
* * *
Was this article helpful to you?
😫😕😀🤩
Last edited on February 01, 2024.
[Edit this page](https://github.com/theatre-js/website/blob/main/content/docs/0.5/030-releases/index.mdx)
#### On this page
* [v0.7.0](https://www.theatrejs.com/docs/0.5/releases#v0.7.0)
* [v0.6.2](https://www.theatrejs.com/docs/0.5/releases#v0.6.2)
* [v0.6.1](https://www.theatrejs.com/docs/0.5/releases#v0.6.1)
* [v0.6.0](https://www.theatrejs.com/docs/0.5/releases#v0.6.0)
* [v0.5.1](https://www.theatrejs.com/docs/0.5/releases#v0.5.1)
* [v0.5](https://www.theatrejs.com/docs/0.5/releases#v0.5)
[Theatre.js](https://www.theatrejs.com/)
Theatre.js is a design tool in the making. We aim to blur the line between designer/developer, author/consumer, and artist/scientist.
#### Get started with
* [React Three Fiber](https://www.theatrejs.com/docs/0.5/getting-started/with-react-three-fiber)
* [THREE.js](https://www.theatrejs.com/docs/0.5/getting-started/with-three-js)
* [HTML/CSS/SVG](https://www.theatrejs.com/docs/0.5/getting-started/with-html-svg)
#### Docs
* [Overview](https://www.theatrejs.com/docs/0.5)
* [Concepts](https://www.theatrejs.com/docs/0.5/concepts)
* [Getting started](https://www.theatrejs.com/docs/0.5/getting-started)
* [Manual](https://www.theatrejs.com/docs/0.5/manual)
* [API](https://www.theatrejs.com/docs/0.5/api)
#### Community
* [Twitter](https://twitter.com/theatre_js)
* [Discord](https://discord.gg/bm9f8F9Y9N)
* [GitHub](https://github.com/theatre-js/theatre)
#### Company
* [Jobs](https://www.theatrejs.com/join)
* [Blog](https://blog.theatrejs.com/)
* [Contact](mailto:hello@theatrejs.com)
© 2022 Theatre.js Oy – Helsinki.
---
# With React Three Fiber – Theatre.js
* [Theatre.js Docs](https://www.theatrejs.com/docs/0.5)
* [Getting started](https://www.theatrejs.com/docs/0.5/getting-started)
* With React Three Fiber
In this guide, you'll learn how to animate a 3D scene by integrating Theatre.js into a [`@react-three/fiber`](https://docs.pmnd.rs/react-three-fiber)
project using the `@theatre/r3f` extension. For a plain Three.js guide, see [Getting started with THREE.js](https://www.theatrejs.com/docs/latest/getting-started/with-three-js)
.
**While Theatre.js is library-agnostic, extensions help you more easily integrate it with other tools, frameworks, and libraries.**
#Prerequisites
--------------
This guide assumes that you have a web project with a bundler set up. Don't have one? No problem, you can follow one of the popular bundler getting start guides: [webpack](https://webpack.js.org/guides/getting-started)
, [esbuild](https://esbuild.github.io/getting-started/)
, [Parcel](https://parceljs.org/getting-started/webapp/)
, or [Vite](https://vitejs.dev/guide/#trying-vite-online)
( recommended).
Once you're set up, navigate to the folder containing the project in your terminal, and you're ready to get started.
#Installing dependencies
------------------------
Run the commands below to install the dependencies we'll be using.
` # r3f and its dependencies npm install --save react three @react-three/fiber # Theatre.js npm install --save @theatre/core@0.5 @theatre/studio@0.5 @theatre/r3f@0.5 # Three.js types (when using Typescript) npm install --save-dev @types/three `
Want to use `yarn`?
` # r3f and its deps yarn add react three @react-three/fiber # Theatre.js yarn add @theatre/core@0.5 @theatre/studio@0.5 @theatre/r3f@0.5 # Three.js types (when using Typescript) yarn add --dev @types/three `
#R3F starter code
-----------------
We will start with the following simple r3f code, and then we'll see how we can add Theatre.js to it.
The code in this guide is TypeScript. You can follow along in JavaScript by removing the type annotations.
To start, we'll create a `main.tsx` file containing the code in the code block below. For example, if you're using the [vite react-ts starter](https://vite.new/react-ts)
, you can replace the entire contents of the `main.tsx` file with the following:
` import * as THREE from 'three' import { createRoot } from 'react-dom/client' import React, { useRef, useState } from 'react' import { Canvas, useFrame } from '@react-three/fiber' import { getProject } from '@theatre/core' // our Theatre.js project sheet, we'll use this later const demoSheet = getProject('Demo Project').sheet('Demo Sheet') const App = () => { return ( ) } createRoot(document.getElementById('root')!).render() `
Tip: To make the canvas full-screen, you can add the following rules to your CSS: `height: 100vh; margin: 0;`
Once you've saved, ran your bundler, and opened the bundled webpage in your browser, you will see something like the following screenshot:

#Adding the Studio UI
---------------------
Now, let's add Theatre.js Studio, the Theatre.js GUI that enables you to edit your scene and animations while developing your project.
Add the following lines below the other imports in `main.tsx` to [initialize](https://www.theatrejs.com/docs/latest/api/studio#studio.initialize)
Theatre.js Studio.
` import studio from '@theatre/studio' studio.initialize() `

You will now see the Studio appear on top of your webpage. However, the r3f extension is still missing. Let's add the extension by calling [studio.extend](https://www.theatrejs.com/docs/latest/api/studio#studio.extend)
:
` import studio from '@theatre/studio' import extension from '@theatre/r3f/dist/extension' studio.initialize() studio.extend(extension) `
You can call [studio.extend](https://www.theatrejs.com/docs/latest/api/studio#studio.extend)
as many times as you want, once for any extension you want to use. You can even [make your own extension](https://www.theatrejs.com/docs/latest/manual/authoring-extensions)
to extend Theatre.js's capabilities.
Tip: only include Theatre.js Studio in "development" builds
If your environment supports it, you can wrap the above code in an environment check to ensure you only include Studio in "development" builds of your webpage.
` // Vite if (import.meta.env.DEV) { studio.initialize() studio.extend(extension) } `
` // create-react-app if (process.env.NODE_ENV === 'development') { studio.initialize() studio.extend(extension) } `
After extending Theatre.js with the r3f extension, a new button will appear in the top left of the UI:

Clicking on it will bring up the scene editor, but the editor will contain an empty space because it is not connected to our scene yet.

We can connect our scene to the r3f extension by wrapping our r3f scene in a [SheetProvider](https://www.theatrejs.com/docs/latest/api/r3f#sheetprovider)
component, which will make the scene visible in the editor. Let's do that.
Add an import of [SheetProvider](https://www.theatrejs.com/docs/latest/api/r3f#sheetprovider)
from `@theatre/r3f`:
` import { SheetProvider } from '@theatre/r3f' `
Then, add a wrapping `` with reference to the `demoSheet` from above:
`` ``
Now, our little yellow cube will show up in Theatre.js' r3f snapshot editor:

#Making objects editable
------------------------
While we can now see objects and move around the scene in the editor, we cannot edit the objects yet. We need to mark objects as editable for the r3f extension to be able to instrument their values.
To make an object editable, import `editable as e` from the extension.
` import { editable as e, SheetProvider } from '@theatre/r3f' `
Then prefix the object's JSX element with `e.`, and add the `theatreKey` prop. The following code will make the point light object editable:
` `
We can verify that the point light object is editable by opening the scene editor and
* click-dragging on the point light to move it around, or
* clicking the object to select it, and then editing its properties in the property editor panel in the top right of the Studio UI.

We can make the cube editable in the same way:
` `
Making the camera editable is a little trickier, since just adding `` will not in itself let r3f know that you want to use it for rendering. You could import the `PerspectiveCamera` component exposed by `@react-three/drei` and make it editable using `const EditableCamera = e(PerspectiveCamera, 'perspectiveCamera')`, however this is a little convoluted for such a common task, hence `@theatre/r3f` exposes a `PerspectiveCamera` component that you can use instead. This component exposes a `makeDefault` prop that you can use to let r3f know that you want to use it for rendering, and it is also editable.
Let's remove the `camera` prop from the `Canvas` element, and add our `PerspectiveCamera` component from `@theatre/r3f`.
` import { PerspectiveCamera } from '@theatre/r3f' `
` `
#Animating objects
------------------
So far, we can move around these objects and edit their properties, but we can also animate them. To start animating, we first have to sequence the properties of an object we want to animate. To sequence properties: select an object, right-click on a property (or group of properties) in the property editor panel, and click "sequence". After clicking "sequence", the sequence editor will open. In this guide, we'll use the sequence editor to animate our cube to do a little dance.

To animate the cube's position, we'll create some keyframes by clicking in the Sequence Editor to move the playhead to a different time in the animation and then dragging the cube around or modifying its position properties. We use these keyframes to set where the cube will be at specific times in the animation.

Once we have some keyframes in the sequence editor, we can play our animation by pressing `Space`.
Tip: If the Studio UI gets in the way, you can hide it by pressing `Alt/Option + \`.
#Getting ready for production
-----------------------------
So far, we've created some keyframes in the sequence editor that result in an animation. You can preview your animation by pressing `Space`. All the keyframes you created are saved in your browser's `localStorage`. So, your animation will be remembered between page refreshes. But now you may want a way to save, share/publish, and programmatically play your animation.
To distribute your animation as a part of your website, export your Theatre.js Project by clicking on "Demo Project" in the outline menu in the top left of the UI, and then click the "Export Demo Project to JSON" button on the right.

This will download a JSON file `state.json`. Now, we can move `state.json` to the folder containing our web project, and import the JSON file:
` import demoProjectState from './state.json' `
Then replace our code from before:
` getProject('Demo Project') `
with this new code:
` getProject('Demo Project', { state: demoProjectState }) `
We are now passing the saved animation state to [getProject](https://www.theatrejs.com/docs/latest/api/core#getproject)
. By doing this, The Theatre.js Project will be initialized with the saved animation from `state.json` instead of with the animation saved in `localStorage`. Don't worry; any changes you make to your animation in Studio will still be saved to `localStorage` after you do this ( your edits will still survive page refreshes).
The last thing left is programmatically playing your animation. Perhaps you will want to play the animation when the App component mounts, or you may want to play it in response to events like a button-click. Here, we'll use code to play the animation in a `useEffect` inside our `App` component.
To play an animation, we need to get a reference to its [sequence](https://www.theatrejs.com/docs/latest/concepts#sequences)
and call the [play](https://www.theatrejs.com/docs/latest/api/core#sequence.play)
method on it. [Sequence.play](https://www.theatrejs.com/docs/latest/api/core#sequence.play)
accepts a number of options. Here, we are going to instruct Theatre.js to play the animation forever and in the range between the `0` second and the `1` second mark:
` const App = () => { useEffect(() => { demoSheet.project.ready.then(() => demoSheet.sequence.play({ iterationCount: Infinity, range: [0, 1] })) }, []) return ( ) } `
In summary, your `main.tsx` should now have the following code:
` import './index.css' import { createRoot } from 'react-dom/client' import React, { useEffect } from 'react' import { Canvas } from '@react-three/fiber' import studio from '@theatre/studio' import extension from '@theatre/r3f/dist/extension' import { SheetProvider, editable as e, PerspectiveCamera } from '@theatre/r3f' import { getProject } from '@theatre/core' import demoProjectState from './state.json' studio.initialize() studio.extend(extension) const demoSheet = getProject('Demo Project', { state: demoProjectState }).sheet('Demo Sheet') const App = () => { useEffect(() => { demoSheet.project.ready.then(() => demoSheet.sequence.play({ iterationCount: Infinity, range: [0, 1] })) }, []) return ( ) } createRoot(document.getElementById('root')!).render() `
To check what our page looks like without the Studio, we can press `Alt/Option + \` to hide it. Alternatively, we can comment out `studio.initialize()`.
#Deploying to production
------------------------
When we are done and ready to deploy our webpage to production, we only need to do two things.
1. Make sure that we have the latest project state exported to a JSON file and passed to [getProject](https://www.theatrejs.com/docs/latest/api/core#getproject)
.
2. Remove [studio.initialize](https://www.theatrejs.com/docs/latest/api/studio#studio.initialize)
and [studio.extend](https://www.theatrejs.com/docs/latest/api/studio#studio.extend)
.
We can also achieve the last step without manually editing the code every time by using environment-checks and relying on our bundler's tree-shaking feature:
` // Vite if (import.meta.env.DEV) { studio.initialize() studio.extend(extension) } `
` // create-react-app if (process.env.NODE_ENV === 'development') { studio.initialize() studio.extend(extension) } `
#Next steps
-----------
In this guide, we walked through how Theatre.js can be used to bring animations to our R3F projects. Consider taking your project a step further by learning a more in-depth topic from [our manual](https://www.theatrejs.com/docs/latest/manual)
:
### Projects
This guide covers creating projects, managing their states, saving and loading their states, and more.
### Sheets
This guide covers Sheets in Theatre.js
### Sheet Objects
This guide covers Sheet Objects in Theatre.js.
### Prop types
Learn how to customize the props you want to animate with Theatre.js. When creating a Sheet Object, we define the props that we want to animate on it. Props can have different types which can be imported from "@theatre/core".
### Working with Sequences
In this guide, we'll explore the tools that Theatre.js offers for creating animations.
### Assets
Learn about assets in Theatre.js
### Using Audio
Learn how to load and synchronize music or narration audio to an animation.
### Studio
Learn the different parts of the Studio.
### Authoring extensions
The Theatre.js Studio API enables you to define extensions that extend the Studio's UI and/or extend the functionality of Studio.
### Keyboard & Mouse Controls
A catalog of controls in Theatre.js Studio.
### Advanced uses
Additionally, learn more about [Theatre.js' concepts](https://www.theatrejs.com/docs/latest/concepts)
. If you need any help or would like to share what you're working on with our community, please [join the Theatre.js Discord](https://discord.gg/bm9f8F9Y9N)
.
* * *
Was this article helpful to you?
😫😕😀🤩
Last edited on February 01, 2024.
[Edit this page](https://github.com/theatre-js/website/blob/main/content/docs/0.5/100-getting-started/100-with-react-three-fiber.mdx)
#### On this page
* [Prerequisites](https://www.theatrejs.com/docs/0.5/getting-started/with-react-three-fiber#prerequisites)
* [Installing dependencies](https://www.theatrejs.com/docs/0.5/getting-started/with-react-three-fiber#installing-dependencies)
* [R3F starter code](https://www.theatrejs.com/docs/0.5/getting-started/with-react-three-fiber#r3f-starter-code)
* [Adding the Studio UI](https://www.theatrejs.com/docs/0.5/getting-started/with-react-three-fiber#adding-the-studio-ui)
* [Making objects editable](https://www.theatrejs.com/docs/0.5/getting-started/with-react-three-fiber#making-objects-editable)
* [Animating objects](https://www.theatrejs.com/docs/0.5/getting-started/with-react-three-fiber#animating-objects)
* [Getting ready for production](https://www.theatrejs.com/docs/0.5/getting-started/with-react-three-fiber#getting-ready-for-production)
* [Deploying to production](https://www.theatrejs.com/docs/0.5/getting-started/with-react-three-fiber#deploying-to-production)
* [Next steps](https://www.theatrejs.com/docs/0.5/getting-started/with-react-three-fiber#next-steps)
[Theatre.js](https://www.theatrejs.com/)
Theatre.js is a design tool in the making. We aim to blur the line between designer/developer, author/consumer, and artist/scientist.
#### Get started with
* [React Three Fiber](https://www.theatrejs.com/docs/0.5/getting-started/with-react-three-fiber)
* [THREE.js](https://www.theatrejs.com/docs/0.5/getting-started/with-three-js)
* [HTML/CSS/SVG](https://www.theatrejs.com/docs/0.5/getting-started/with-html-svg)
#### Docs
* [Overview](https://www.theatrejs.com/docs/0.5)
* [Concepts](https://www.theatrejs.com/docs/0.5/concepts)
* [Getting started](https://www.theatrejs.com/docs/0.5/getting-started)
* [Manual](https://www.theatrejs.com/docs/0.5/manual)
* [API](https://www.theatrejs.com/docs/0.5/api)
#### Community
* [Twitter](https://twitter.com/theatre_js)
* [Discord](https://discord.gg/bm9f8F9Y9N)
* [GitHub](https://github.com/theatre-js/theatre)
#### Company
* [Jobs](https://www.theatrejs.com/join)
* [Blog](https://blog.theatrejs.com/)
* [Contact](mailto:hello@theatrejs.com)
© 2022 Theatre.js Oy – Helsinki.
---
# Concepts – Theatre.js
* [Theatre.js Docs](https://www.theatrejs.com/docs/latest)
* Concepts
#Objects
--------
An animated illustration of Theatre.js objects. Side-by-side animations of a jumping cube and button.
**Everything that is animated** is represented as an object. Objects can be THREE.js objects or virtual objects that don't exist on the screen.
#Props
------
**Objects are made up of props.** Each prop can have a different type and can be sequenced.

### #Changing props
Props can be changed via Theatre's UI or via code.
A video of the Theatre.js UI with a cube on the webpage. Shows the mouse moving the cube up and down using the grabbable axis in the 3D editor and shows the user changing the y value of the cube in the UI.
#Sheets
-------
Sheets **contain one or more objects** that can be animated together.
An animated illustration of Theatre.js sheets. Shows a cube jumping (obj1) and some dust particles (obj2).
### #Sheet instances
An animated illustration of Theatre.js sheet instances. Shows three identical animations of a cube jumping with offset animation start times.
You can **re-use a sheet by making instances** of it. That means we can have more than one jumpidy-jump animation, each with its own little box and dust particles.
### #Sequences
An animated illustration of Theatre.js sequences. Shows a cube jumping animations with the Theatre.js Studio "dope sheet" panel below. The dope sheet panel contains a moving playhead and visual representations of props with tracks containing keyframes and tweens.
Each sheet has a single sequence _(multi-sequence sheets are in the works!)_. A sequence is basically made up of **all of the keyframes of all of the objects in a sheet**.
#Extensions
-----------

**Extensions can make creating and editing objects for your animation much easier**. They can provide editor gizmos, toolbars, and even their own panes.
* * *
Was this article helpful to you?
😫😕😀🤩
Last edited on February 01, 2024.
[Edit this page](https://github.com/theatre-js/website/blob/main/content/docs/0.5/020-concepts/index.mdx)
#### On this page
* [Objects](https://www.theatrejs.com/docs/latest/concepts#objects)
* [Props](https://www.theatrejs.com/docs/latest/concepts#props)
* [Changing props](https://www.theatrejs.com/docs/latest/concepts#changing-props)
* [Sheets](https://www.theatrejs.com/docs/latest/concepts#sheets)
* [Sheet instances](https://www.theatrejs.com/docs/latest/concepts#sheet-instances)
* [Sequences](https://www.theatrejs.com/docs/latest/concepts#sequences)
* [Extensions](https://www.theatrejs.com/docs/latest/concepts#extensions)
[Theatre.js](https://www.theatrejs.com/)
Theatre.js is a design tool in the making. We aim to blur the line between designer/developer, author/consumer, and artist/scientist.
#### Get started with
* [React Three Fiber](https://www.theatrejs.com/docs/0.5/getting-started/with-react-three-fiber)
* [THREE.js](https://www.theatrejs.com/docs/0.5/getting-started/with-three-js)
* [HTML/CSS/SVG](https://www.theatrejs.com/docs/0.5/getting-started/with-html-svg)
#### Docs
* [Overview](https://www.theatrejs.com/docs/0.5)
* [Concepts](https://www.theatrejs.com/docs/0.5/concepts)
* [Getting started](https://www.theatrejs.com/docs/0.5/getting-started)
* [Manual](https://www.theatrejs.com/docs/0.5/manual)
* [API](https://www.theatrejs.com/docs/0.5/api)
#### Community
* [Twitter](https://twitter.com/theatre_js)
* [Discord](https://discord.gg/bm9f8F9Y9N)
* [GitHub](https://github.com/theatre-js/theatre)
#### Company
* [Jobs](https://www.theatrejs.com/join)
* [Blog](https://blog.theatrejs.com/)
* [Contact](mailto:hello@theatrejs.com)
© 2022 Theatre.js Oy – Helsinki.
---
# Getting started – Theatre.js
* [Theatre.js Docs](https://www.theatrejs.com/docs/0.5)
* Getting started
* * *
### With React Three Fiber
Animate a React Three Fiber project using Theatre.js's r3f extension, "@theatre/r3f". This guide assumes that you have a web project with a bundler set up.
### With THREE.js
Animate a 3D scene by integrating Theatre.js into a THREE.js project. Theatre.js can be used with THREE.js to animate things like the camera, lights, material colors, and more.
### With HTML/SVG
How to get started animating HTML elements directly with Theatre.js. This tutorial doesn't require any knowledge beyond HTML + JavaScript.
* * *
Was this article helpful to you?
😫😕😀🤩
Last edited on February 01, 2024.
[Edit this page](https://github.com/theatre-js/website/blob/main/content/docs/0.5/100-getting-started/index.mdx)
[Theatre.js](https://www.theatrejs.com/)
Theatre.js is a design tool in the making. We aim to blur the line between designer/developer, author/consumer, and artist/scientist.
#### Get started with
* [React Three Fiber](https://www.theatrejs.com/docs/0.5/getting-started/with-react-three-fiber)
* [THREE.js](https://www.theatrejs.com/docs/0.5/getting-started/with-three-js)
* [HTML/CSS/SVG](https://www.theatrejs.com/docs/0.5/getting-started/with-html-svg)
#### Docs
* [Overview](https://www.theatrejs.com/docs/0.5)
* [Concepts](https://www.theatrejs.com/docs/0.5/concepts)
* [Getting started](https://www.theatrejs.com/docs/0.5/getting-started)
* [Manual](https://www.theatrejs.com/docs/0.5/manual)
* [API](https://www.theatrejs.com/docs/0.5/api)
#### Community
* [Twitter](https://twitter.com/theatre_js)
* [Discord](https://discord.gg/bm9f8F9Y9N)
* [GitHub](https://github.com/theatre-js/theatre)
#### Company
* [Jobs](https://www.theatrejs.com/join)
* [Blog](https://blog.theatrejs.com/)
* [Contact](mailto:hello@theatrejs.com)
© 2022 Theatre.js Oy – Helsinki.
---
# With THREE.js – Theatre.js
* [Theatre.js Docs](https://www.theatrejs.com/docs/latest)
* [Getting started](https://www.theatrejs.com/docs/latest/getting-started)
* With THREE.js
In this guide, you'll learn how to animate a 3D scene by integrating Theatre.js into a [THREE.js](https://threejs.org/)
project. Theatre.js can be used with THREE.js to animate things like the camera, lights, material colors, and more.
#Prerequisites
--------------
We'll start by cloning or downloading the code in the [THREE.js + bundler project repository](https://github.com/fulopkovacs/vanilla-threejs-project)
.
` # using git git clone https://github.com/fulopkovacs/vanilla-threejs-project `
Alternatively, you can download [the ZIP archive of the code](https://github.com/fulopkovacs/vanilla-threejs-project/archive/refs/heads/main.zip)
and extract it to a folder of your choice.
This code will set up a basic THREE.js scene with a torus know geometry, basic lighting, and a render loop.
This project uses Vite, but you really just need a basic web project set up with a bundler of your choice with some code to set up a [basic THREE.js scene](https://threejs.org/docs/#manual/en/introduction/Creating-a-scene)
.
Once you have your project cloned, navigate to the project folder in your terminal.
` # open the repository in your terminal cd vanilla-threejs-project `
And use a package manager of your choice (e.g., npm or yarn) to install dependencies to the `./node_modules` folder.
` # install the dependencies: npm install # and start the dev server: npm run dev `
Or with yarn:
` # install the dependencies: yarn install # and start the dev server: yarn run dev `
Now, if you open [`http://localhost:3000`](http://localhost:3000/)
in the browser, you should see something like this:

#Add Theatre.js packages
------------------------
Now that you have a THREE.js codebase you want to add Theatre.js to, let's install Theatre.js's packages.
` # with npm npm install --save @theatre/core @theatre/studio # or with yarn yarn add @theatre/core @theatre/studio `
#Create an animation
--------------------
Theatre.js has two essential packages that we need to use in this project. `@theatre/studio` is the editor GUI that we use to create animations, and `@theatre/core` plays the animations we've created. If you're using the started project, naviage to the `main.ts` file and let's import the studio package and initialize the editor:
` /* ... */ import * as THREE from 'three' import studio from '@theatre/studio' /** * Theatre.js */ studio.initialize() /* ... */ `

#Animate the rotation of the TorusKnot
--------------------------------------
So far, we cannot edit anything using the UI; we need to hook up our THREE.js objects to Theatre.js first. There are a lot of things we could animate in the starting scene, but let's focus on the rotation of the `torusKnot` for now.
First, create a Theatre.js project using the code below. A [Project](https://www.theatrejs.com/docs/latest/manual/projects)
in Theatre.js is like a save file. Projects are stored in the browser's `localStorage`, so you don't lose your progress if you close and reopen Theatre.js.
` import * as THREE from 'three' import { getProject } from '@theatre/core' // Initialize the studio studio.initialize() // Create a project for the animation const project = getProject('THREE.js x Theatre.js') `
Now we'll add a [Sheet](https://www.theatrejs.com/docs/latest/manual/sheets)
. Sheets are a collection of objects which can be animated together.
` /* ... */ // Create a project for the animation const project = getProject('THREE.js x Theatre.js') // Create a sheet const sheet = project.sheet('Animated scene') `
Next, we'll create a [Sheet Object](https://www.theatrejs.com/docs/latest/manual/objects)
with the [props](https://www.theatrejs.com/docs/latest/manual/prop-types)
that you want to animate. Sheets contain one or more objects, that can be animated together. You can customize how these props look and behave in the UI, e.g. you can set minimum and maximum values of a number prop by modifying its `range`.
` import * as THREE from 'three' import { getProject, types } from '@theatre/core' /* ... */ scene.add(mesh) // Create a Theatre.js object with the props you want to // animate const torusKnotObj = sheet.object('Torus Knot', { // Note that the rotation is in radians // (full rotation: 2 * Math.PI) rotation: types.compound({ x: types.number(mesh.rotation.x, { range: [-2, 2] }), y: types.number(mesh.rotation.y, { range: [-2, 2] }), z: types.number(mesh.rotation.z, { range: [-2, 2] }), }), }) `
The last thing to do is to rotate the torusKnot's mesh based on the values of `torusKnotObj`. This can be done by listening to the changes of the `torusKnotObj` and updating the rotation of the `torusKnot`.
` const torusKnotObj = sheet.object('Torus Knot', { /* ... */ }) torusKnotObj.onValuesChange((values) => { const { x, y, z } = values.rotation mesh.rotation.set(x * Math.PI, y * Math.PI, z * Math.PI) }) `
Now you're set up to use the [Studio](https://www.theatrejs.com/docs/latest/manual/Studio)
to edit and animate the torusKnot's rotation!
#Animating objects
------------------
To start animating, we first have to sequence the properties of an object we want to animate. To sequence properties: select an object, right-click on a property (or group of properties) in the property editor panel, and click "sequence". After clicking "sequence", the sequence editor will open. Here, we'll sequence the rotation of the torus knot.
Sequencing props
To animate the knot's rotation, we'll create two sets of keyframes by clicking on the yellow diamond next to the rotation prop in the [Details Panel](https://www.theatrejs.com/docs/latest/manual/Studio#details-panel)
, one with the playhead at `0s`, and one at `3s`. We'll then set the first set of keyframes to `0`, and the second set to `1`.
Animating props
You can of course experiment with adding more keyframes.
Once we have some keyframes in the sequence editor, we can play our animation by pressing `Space`.
Tip: If the Studio UI gets in the way, you can hide it by pressing `Alt/Option + \`.
To learn more about creating animations, see [Working with Sequences](https://www.theatrejs.com/docs/latest/manual/sequences)
.

#Getting ready for production
-----------------------------
All the keyframes you created are saved in your browser's `localStorage` so that your animation will be remembered between page refreshes. However, now you may want a way to save, share/publish, and programmatically play your animation.
To distribute your animation as a part of your website, export your Theatre.js Project by clicking on "THREE.js x Theatre.js" in the outline menu in the top left of the UI.

Then click on the "Export THREE.js x Theatre.js to JSON" button on the right.

This will download a JSON file `state.json`. Now, we can move `state.json` to the folder containing our web project, and import the JSON file:
` import projectState from './state.json' `
Then replace our code from before:
` const project = getProject('THREE.js x Theatre.js') `
With this code:
` const project = getProject('THREE.js x Theatre.js', { state: projectState }) `
We are now passing the saved animation state to [getProject](https://www.theatrejs.com/docs/latest/api/core#getproject)
. By doing this,the Theatre.js project will be initialized with the saved animation from `state.json` instead of the animation saved in `localStorage`. Don't worry; any changes you make to your animation in Studio will still be saved to `localStorage` after you do this (your edits will still survive page refreshes).
The last thing left is programmatically playing your animation.
To play an animation, we need to get a reference to its [sequence](https://www.theatrejs.com/docs/latest/concepts#sequences)
and call the [play](https://www.theatrejs.com/docs/latest/api/core#sequence.play)
method on it. [Sequence.play](https://www.theatrejs.com/docs/latest/api/core#sequence.play)
accepts a number of options. Here, we are going to instruct Theatre.js to play the animation forever.
` // Play the animation on repeat project.ready.then(() => sheet.sequence.play({ iterationCount: Infinity })) `
In summary, your code will now look like the following [GitHub repo](https://github.com/fulopkovacs/threejs-x-theatrejs)
.
To check what our page looks like without the Studio, we can press `Alt/Option + \` to hide it. Alternatively, we can comment out `studio.initialize()`.
#Deploying to production
------------------------
When we are done and ready to deploy our webpage to production, we only need to do two things.
1. Make sure that we have the latest project state exported to a JSON file and passed to [getProject](https://www.theatrejs.com/docs/latest/api/core#getproject)
.
2. Remove [studio.initialize](https://www.theatrejs.com/docs/latest/api/studio#studio.initialize)
and [studio.extend](https://www.theatrejs.com/docs/latest/api/studio#studio.extend)
.
We can also achieve the last step without manually editing the code every time by using environment-checks and relying on our bundler's tree-shaking feature:
` // Vite if (import.meta.env.DEV) { studio.initialize() studio.extend(extension) } `
` // create-react-app if (process.env.NODE_ENV === 'development') { studio.initialize() studio.extend(extension) } `
#Next steps
-----------
Want to learn more? Take a look at some more in-depth topics from [our manual](https://www.theatrejs.com/docs/latest/manual)
:
### Projects
This guide covers creating projects, managing their states, saving and loading their states, and more.
### Sheets
This guide covers Sheets in Theatre.js
### Sheet Objects
This guide covers Sheet Objects in Theatre.js.
### Prop types
Learn how to customize the props you want to animate with Theatre.js. When creating a Sheet Object, we define the props that we want to animate on it. Props can have different types which can be imported from "@theatre/core".
### Working with Sequences
In this guide, we'll explore the tools that Theatre.js offers for creating animations.
### Assets
Learn about assets in Theatre.js
### Using Audio
Learn how to load and synchronize music or narration audio to an animation.
### Studio
Learn the different parts of the Studio.
### Authoring extensions
The Theatre.js Studio API enables you to define extensions that extend the Studio's UI and/or extend the functionality of Studio.
### Keyboard & Mouse Controls
A catalog of controls in Theatre.js Studio.
### Advanced uses
Or check out another getting started guide:
### With React Three Fiber
Animate a React Three Fiber project using Theatre.js's r3f extension, "@theatre/r3f". This guide assumes that you have a web project with a bundler set up.
### With HTML/SVG
How to get started animating HTML elements directly with Theatre.js. This tutorial doesn't require any knowledge beyond HTML + JavaScript.
* * *
Was this article helpful to you?
😫😕😀🤩
Last edited on February 01, 2024.
[Edit this page](https://github.com/theatre-js/website/blob/main/content/docs/0.5/100-getting-started/200-with-three-js.mdx)
#### On this page
* [Prerequisites](https://www.theatrejs.com/docs/latest/getting-started/with-three-js#prerequisites)
* [Add Theatre.js packages](https://www.theatrejs.com/docs/latest/getting-started/with-three-js#add-theatre.js-packages)
* [Create an animation](https://www.theatrejs.com/docs/latest/getting-started/with-three-js#create-an-animation)
* [Animate the rotation of the TorusKnot](https://www.theatrejs.com/docs/latest/getting-started/with-three-js#animate-the-rotation-of-the-torusknot)
* [Animating objects](https://www.theatrejs.com/docs/latest/getting-started/with-three-js#animating-objects)
* [Getting ready for production](https://www.theatrejs.com/docs/latest/getting-started/with-three-js#getting-ready-for-production)
* [Deploying to production](https://www.theatrejs.com/docs/latest/getting-started/with-three-js#deploying-to-production)
* [Next steps](https://www.theatrejs.com/docs/latest/getting-started/with-three-js#next-steps)
[Theatre.js](https://www.theatrejs.com/)
Theatre.js is a design tool in the making. We aim to blur the line between designer/developer, author/consumer, and artist/scientist.
#### Get started with
* [React Three Fiber](https://www.theatrejs.com/docs/0.5/getting-started/with-react-three-fiber)
* [THREE.js](https://www.theatrejs.com/docs/0.5/getting-started/with-three-js)
* [HTML/CSS/SVG](https://www.theatrejs.com/docs/0.5/getting-started/with-html-svg)
#### Docs
* [Overview](https://www.theatrejs.com/docs/0.5)
* [Concepts](https://www.theatrejs.com/docs/0.5/concepts)
* [Getting started](https://www.theatrejs.com/docs/0.5/getting-started)
* [Manual](https://www.theatrejs.com/docs/0.5/manual)
* [API](https://www.theatrejs.com/docs/0.5/api)
#### Community
* [Twitter](https://twitter.com/theatre_js)
* [Discord](https://discord.gg/bm9f8F9Y9N)
* [GitHub](https://github.com/theatre-js/theatre)
#### Company
* [Jobs](https://www.theatrejs.com/join)
* [Blog](https://blog.theatrejs.com/)
* [Contact](mailto:hello@theatrejs.com)
© 2022 Theatre.js Oy – Helsinki.
---
# With React Three Fiber – Theatre.js
* [Theatre.js Docs](https://www.theatrejs.com/docs/latest)
* [Getting started](https://www.theatrejs.com/docs/latest/getting-started)
* With React Three Fiber
In this guide, you'll learn how to animate a 3D scene by integrating Theatre.js into a [`@react-three/fiber`](https://docs.pmnd.rs/react-three-fiber)
project using the `@theatre/r3f` extension. For a plain Three.js guide, see [Getting started with THREE.js](https://www.theatrejs.com/docs/latest/getting-started/with-three-js)
.
**While Theatre.js is library-agnostic, extensions help you more easily integrate it with other tools, frameworks, and libraries.**
#Prerequisites
--------------
This guide assumes that you have a web project with a bundler set up. Don't have one? No problem, you can follow one of the popular bundler getting start guides: [webpack](https://webpack.js.org/guides/getting-started)
, [esbuild](https://esbuild.github.io/getting-started/)
, [Parcel](https://parceljs.org/getting-started/webapp/)
, or [Vite](https://vitejs.dev/guide/#trying-vite-online)
( recommended).
Once you're set up, navigate to the folder containing the project in your terminal, and you're ready to get started.
#Installing dependencies
------------------------
Run the commands below to install the dependencies we'll be using.
` # r3f and its dependencies npm install --save react three @react-three/fiber # Theatre.js npm install --save @theatre/core@0.5 @theatre/studio@0.5 @theatre/r3f@0.5 # Three.js types (when using Typescript) npm install --save-dev @types/three `
Want to use `yarn`?
` # r3f and its deps yarn add react three @react-three/fiber # Theatre.js yarn add @theatre/core@0.5 @theatre/studio@0.5 @theatre/r3f@0.5 # Three.js types (when using Typescript) yarn add --dev @types/three `
#R3F starter code
-----------------
We will start with the following simple r3f code, and then we'll see how we can add Theatre.js to it.
The code in this guide is TypeScript. You can follow along in JavaScript by removing the type annotations.
To start, we'll create a `main.tsx` file containing the code in the code block below. For example, if you're using the [vite react-ts starter](https://vite.new/react-ts)
, you can replace the entire contents of the `main.tsx` file with the following:
` import * as THREE from 'three' import { createRoot } from 'react-dom/client' import React, { useRef, useState } from 'react' import { Canvas, useFrame } from '@react-three/fiber' import { getProject } from '@theatre/core' // our Theatre.js project sheet, we'll use this later const demoSheet = getProject('Demo Project').sheet('Demo Sheet') const App = () => { return ( ) } createRoot(document.getElementById('root')!).render() `
Tip: To make the canvas full-screen, you can add the following rules to your CSS: `height: 100vh; margin: 0;`
Once you've saved, ran your bundler, and opened the bundled webpage in your browser, you will see something like the following screenshot:

#Adding the Studio UI
---------------------
Now, let's add Theatre.js Studio, the Theatre.js GUI that enables you to edit your scene and animations while developing your project.
Add the following lines below the other imports in `main.tsx` to [initialize](https://www.theatrejs.com/docs/latest/api/studio#studio.initialize)
Theatre.js Studio.
` import studio from '@theatre/studio' studio.initialize() `

You will now see the Studio appear on top of your webpage. However, the r3f extension is still missing. Let's add the extension by calling [studio.extend](https://www.theatrejs.com/docs/latest/api/studio#studio.extend)
:
` import studio from '@theatre/studio' import extension from '@theatre/r3f/dist/extension' studio.initialize() studio.extend(extension) `
You can call [studio.extend](https://www.theatrejs.com/docs/latest/api/studio#studio.extend)
as many times as you want, once for any extension you want to use. You can even [make your own extension](https://www.theatrejs.com/docs/latest/manual/authoring-extensions)
to extend Theatre.js's capabilities.
Tip: only include Theatre.js Studio in "development" builds
If your environment supports it, you can wrap the above code in an environment check to ensure you only include Studio in "development" builds of your webpage.
` // Vite if (import.meta.env.DEV) { studio.initialize() studio.extend(extension) } `
` // create-react-app if (process.env.NODE_ENV === 'development') { studio.initialize() studio.extend(extension) } `
After extending Theatre.js with the r3f extension, a new button will appear in the top left of the UI:

Clicking on it will bring up the scene editor, but the editor will contain an empty space because it is not connected to our scene yet.

We can connect our scene to the r3f extension by wrapping our r3f scene in a [SheetProvider](https://www.theatrejs.com/docs/latest/api/r3f#sheetprovider)
component, which will make the scene visible in the editor. Let's do that.
Add an import of [SheetProvider](https://www.theatrejs.com/docs/latest/api/r3f#sheetprovider)
from `@theatre/r3f`:
` import { SheetProvider } from '@theatre/r3f' `
Then, add a wrapping `` with reference to the `demoSheet` from above:
`` ``
Now, our little yellow cube will show up in Theatre.js' r3f snapshot editor:

#Making objects editable
------------------------
While we can now see objects and move around the scene in the editor, we cannot edit the objects yet. We need to mark objects as editable for the r3f extension to be able to instrument their values.
To make an object editable, import `editable as e` from the extension.
` import { editable as e, SheetProvider } from '@theatre/r3f' `
Then prefix the object's JSX element with `e.`, and add the `theatreKey` prop. The following code will make the point light object editable:
` `
We can verify that the point light object is editable by opening the scene editor and
* click-dragging on the point light to move it around, or
* clicking the object to select it, and then editing its properties in the property editor panel in the top right of the Studio UI.

We can make the cube editable in the same way:
` `
Making the camera editable is a little trickier, since just adding `` will not in itself let r3f know that you want to use it for rendering. You could import the `PerspectiveCamera` component exposed by `@react-three/drei` and make it editable using `const EditableCamera = e(PerspectiveCamera, 'perspectiveCamera')`, however this is a little convoluted for such a common task, hence `@theatre/r3f` exposes a `PerspectiveCamera` component that you can use instead. This component exposes a `makeDefault` prop that you can use to let r3f know that you want to use it for rendering, and it is also editable.
Let's remove the `camera` prop from the `Canvas` element, and add our `PerspectiveCamera` component from `@theatre/r3f`.
` import { PerspectiveCamera } from '@theatre/r3f' `
` `
#Animating objects
------------------
So far, we can move around these objects and edit their properties, but we can also animate them. To start animating, we first have to sequence the properties of an object we want to animate. To sequence properties: select an object, right-click on a property (or group of properties) in the property editor panel, and click "sequence". After clicking "sequence", the sequence editor will open. In this guide, we'll use the sequence editor to animate our cube to do a little dance.

To animate the cube's position, we'll create some keyframes by clicking in the Sequence Editor to move the playhead to a different time in the animation and then dragging the cube around or modifying its position properties. We use these keyframes to set where the cube will be at specific times in the animation.

Once we have some keyframes in the sequence editor, we can play our animation by pressing `Space`.
Tip: If the Studio UI gets in the way, you can hide it by pressing `Alt/Option + \`.
#Getting ready for production
-----------------------------
So far, we've created some keyframes in the sequence editor that result in an animation. You can preview your animation by pressing `Space`. All the keyframes you created are saved in your browser's `localStorage`. So, your animation will be remembered between page refreshes. But now you may want a way to save, share/publish, and programmatically play your animation.
To distribute your animation as a part of your website, export your Theatre.js Project by clicking on "Demo Project" in the outline menu in the top left of the UI, and then click the "Export Demo Project to JSON" button on the right.

This will download a JSON file `state.json`. Now, we can move `state.json` to the folder containing our web project, and import the JSON file:
` import demoProjectState from './state.json' `
Then replace our code from before:
` getProject('Demo Project') `
with this new code:
` getProject('Demo Project', { state: demoProjectState }) `
We are now passing the saved animation state to [getProject](https://www.theatrejs.com/docs/latest/api/core#getproject)
. By doing this, The Theatre.js Project will be initialized with the saved animation from `state.json` instead of with the animation saved in `localStorage`. Don't worry; any changes you make to your animation in Studio will still be saved to `localStorage` after you do this ( your edits will still survive page refreshes).
The last thing left is programmatically playing your animation. Perhaps you will want to play the animation when the App component mounts, or you may want to play it in response to events like a button-click. Here, we'll use code to play the animation in a `useEffect` inside our `App` component.
To play an animation, we need to get a reference to its [sequence](https://www.theatrejs.com/docs/latest/concepts#sequences)
and call the [play](https://www.theatrejs.com/docs/latest/api/core#sequence.play)
method on it. [Sequence.play](https://www.theatrejs.com/docs/latest/api/core#sequence.play)
accepts a number of options. Here, we are going to instruct Theatre.js to play the animation forever and in the range between the `0` second and the `1` second mark:
` const App = () => { useEffect(() => { demoSheet.project.ready.then(() => demoSheet.sequence.play({ iterationCount: Infinity, range: [0, 1] })) }, []) return ( ) } `
In summary, your `main.tsx` should now have the following code:
` import './index.css' import { createRoot } from 'react-dom/client' import React, { useEffect } from 'react' import { Canvas } from '@react-three/fiber' import studio from '@theatre/studio' import extension from '@theatre/r3f/dist/extension' import { SheetProvider, editable as e, PerspectiveCamera } from '@theatre/r3f' import { getProject } from '@theatre/core' import demoProjectState from './state.json' studio.initialize() studio.extend(extension) const demoSheet = getProject('Demo Project', { state: demoProjectState }).sheet('Demo Sheet') const App = () => { useEffect(() => { demoSheet.project.ready.then(() => demoSheet.sequence.play({ iterationCount: Infinity, range: [0, 1] })) }, []) return ( ) } createRoot(document.getElementById('root')!).render() `
To check what our page looks like without the Studio, we can press `Alt/Option + \` to hide it. Alternatively, we can comment out `studio.initialize()`.
#Deploying to production
------------------------
When we are done and ready to deploy our webpage to production, we only need to do two things.
1. Make sure that we have the latest project state exported to a JSON file and passed to [getProject](https://www.theatrejs.com/docs/latest/api/core#getproject)
.
2. Remove [studio.initialize](https://www.theatrejs.com/docs/latest/api/studio#studio.initialize)
and [studio.extend](https://www.theatrejs.com/docs/latest/api/studio#studio.extend)
.
We can also achieve the last step without manually editing the code every time by using environment-checks and relying on our bundler's tree-shaking feature:
` // Vite if (import.meta.env.DEV) { studio.initialize() studio.extend(extension) } `
` // create-react-app if (process.env.NODE_ENV === 'development') { studio.initialize() studio.extend(extension) } `
#Next steps
-----------
In this guide, we walked through how Theatre.js can be used to bring animations to our R3F projects. Consider taking your project a step further by learning a more in-depth topic from [our manual](https://www.theatrejs.com/docs/latest/manual)
:
### Projects
This guide covers creating projects, managing their states, saving and loading their states, and more.
### Sheets
This guide covers Sheets in Theatre.js
### Sheet Objects
This guide covers Sheet Objects in Theatre.js.
### Prop types
Learn how to customize the props you want to animate with Theatre.js. When creating a Sheet Object, we define the props that we want to animate on it. Props can have different types which can be imported from "@theatre/core".
### Working with Sequences
In this guide, we'll explore the tools that Theatre.js offers for creating animations.
### Assets
Learn about assets in Theatre.js
### Using Audio
Learn how to load and synchronize music or narration audio to an animation.
### Studio
Learn the different parts of the Studio.
### Authoring extensions
The Theatre.js Studio API enables you to define extensions that extend the Studio's UI and/or extend the functionality of Studio.
### Keyboard & Mouse Controls
A catalog of controls in Theatre.js Studio.
### Advanced uses
Additionally, learn more about [Theatre.js' concepts](https://www.theatrejs.com/docs/latest/concepts)
. If you need any help or would like to share what you're working on with our community, please [join the Theatre.js Discord](https://discord.gg/bm9f8F9Y9N)
.
* * *
Was this article helpful to you?
😫😕😀🤩
Last edited on February 01, 2024.
[Edit this page](https://github.com/theatre-js/website/blob/main/content/docs/0.5/100-getting-started/100-with-react-three-fiber.mdx)
#### On this page
* [Prerequisites](https://www.theatrejs.com/docs/latest/getting-started/with-react-three-fiber#prerequisites)
* [Installing dependencies](https://www.theatrejs.com/docs/latest/getting-started/with-react-three-fiber#installing-dependencies)
* [R3F starter code](https://www.theatrejs.com/docs/latest/getting-started/with-react-three-fiber#r3f-starter-code)
* [Adding the Studio UI](https://www.theatrejs.com/docs/latest/getting-started/with-react-three-fiber#adding-the-studio-ui)
* [Making objects editable](https://www.theatrejs.com/docs/latest/getting-started/with-react-three-fiber#making-objects-editable)
* [Animating objects](https://www.theatrejs.com/docs/latest/getting-started/with-react-three-fiber#animating-objects)
* [Getting ready for production](https://www.theatrejs.com/docs/latest/getting-started/with-react-three-fiber#getting-ready-for-production)
* [Deploying to production](https://www.theatrejs.com/docs/latest/getting-started/with-react-three-fiber#deploying-to-production)
* [Next steps](https://www.theatrejs.com/docs/latest/getting-started/with-react-three-fiber#next-steps)
[Theatre.js](https://www.theatrejs.com/)
Theatre.js is a design tool in the making. We aim to blur the line between designer/developer, author/consumer, and artist/scientist.
#### Get started with
* [React Three Fiber](https://www.theatrejs.com/docs/0.5/getting-started/with-react-three-fiber)
* [THREE.js](https://www.theatrejs.com/docs/0.5/getting-started/with-three-js)
* [HTML/CSS/SVG](https://www.theatrejs.com/docs/0.5/getting-started/with-html-svg)
#### Docs
* [Overview](https://www.theatrejs.com/docs/0.5)
* [Concepts](https://www.theatrejs.com/docs/0.5/concepts)
* [Getting started](https://www.theatrejs.com/docs/0.5/getting-started)
* [Manual](https://www.theatrejs.com/docs/0.5/manual)
* [API](https://www.theatrejs.com/docs/0.5/api)
#### Community
* [Twitter](https://twitter.com/theatre_js)
* [Discord](https://discord.gg/bm9f8F9Y9N)
* [GitHub](https://github.com/theatre-js/theatre)
#### Company
* [Jobs](https://www.theatrejs.com/join)
* [Blog](https://blog.theatrejs.com/)
* [Contact](mailto:hello@theatrejs.com)
© 2022 Theatre.js Oy – Helsinki.
---
# With HTML/SVG – Theatre.js
* [Theatre.js Docs](https://www.theatrejs.com/docs/0.5)
* [Getting started](https://www.theatrejs.com/docs/0.5/getting-started)
* With HTML/SVG
This guide just assumes you have familiarity with HTML and JavaScript. No package management or bundling is involved.
In this tutorial, we will:
1. Show the Theatre.js Studio UI on a simple HTML page
2. Create a new Theatre.js Project which will control JavaScript values on the page
3. Use Theatre.js to animate UI elements on our page
4. Create a production (publishable) version of our Project we can share with users, collaborators, or friends
#Prerequisites
--------------
Let's start by creating a basic HTML file called `animation-tutorial.html`. Below is a starter HTML file. It only contains the basic tags an HTML page should have, nothing Theatre.js specific yet.
animation-tutorial.html
` Theatre.js Tutorial Welcome
`
If we've saved the above HTML in a file called `animation-tutorial.html` and open that file in our browser, it results in a Welcome page that looks like the following:
#Add Theatre.js Studio
----------------------
To add functionality to our static HTML page, we should first set up our Theatre.js **Project**. Let's add the following JS into the `