Velagetting started

Installation

Install Vela, wire it into your roblox-ts build, and confirm it works.

Vela compiles Tailwind-style class names on your roblox-ts UI into Roblox properties at build time. This page takes an existing roblox-ts project to a working build. No project yet? Start from roblox-ts’s quick start.

Install the packages

Install Vela:

pnpm add vela-rbxts

Then the UI library you write JSX with. For React:

pnpm add @rbxts/react @rbxts/react-roblox @rbxts/services

For Vide instead:

pnpm add @rbxts/vide @rbxts/services

And the roblox-ts toolchain:

pnpm add -D roblox-ts typescript@5.9.3 @rbxts/compiler-types @rbxts/types

Keep TypeScript on 5.9.3 or 6.x. TypeScript 7 breaks the build (details).

Choose how Vela runs

Vela can run inside rbxtsc as a plugin, or as a separate step before it. Both use the same compiler.

TransformerCLI
Build commandrbxtscvela build && rbxtsc
Lowered outputStays in memoryWritten to .vela/src, so you can read it
Use it whenrbxtsc is your buildYour toolchain can’t load plugins

If you’re unsure, pick the transformer.

Option A: the transformer

Add one plugin entry to tsconfig.json:

tsconfig.json
{
"compilerOptions": {
"plugins": [{ "transform": "vela-rbxts/transformer" }]
}
}

Transformer options are covered in the configuration reference.

Option B: the CLI

Point rbxtsc at the tree Vela generates, and register no plugin:

tsconfig.json
{
"compilerOptions": {
"rootDir": ".vela/src",
"baseUrl": ".vela/src",
"outDir": "out"
},
"include": [".vela/src"]
}

vela build copies src into .vela/src and transforms the .tsx files on the way. Always edit src. The generated tree is overwritten on every build. See the CLI reference for every flag.

Declare the className prop

Create this file so TypeScript accepts className on Roblox elements:

src/vela-env.d.ts
import "vela-rbxts";

Any file name works except src/vela-rbxts.d.ts, which silently breaks the import.

Add a theme (optional)

Vela works without a config file. To add your own theme values, create vela.config.ts at the project root (not inside src):

vela.config.ts
import { defineConfig } from "vela-rbxts";
export default defineConfig({
theme: {
extend: {
colors: {
brand: {
500: "Color3.fromRGB(59, 130, 246)",
},
},
},
},
});

Put your values under theme.extend. A top-level theme.colors replaces the default palette entirely. The theming guide covers the rest, including defining tokens in a vela.css file.

Build and check it works

Add a deliberately broken class to any .tsx file:

src/client/Smoke.tsx
<frame className="bg-nope-500 p-4" />

Then build. With the transformer:

Terminal window
npx rbxtsc

With the CLI:

Terminal window
npx vela build && npx vela rbxtsc -p tsconfig.json

You should see a warning naming nope-500:

rbxtsc output
src/client/Smoke.tsx:4:28 - warning TS89000: [@vela-rbxts/compiler] unknown-theme-key: Unknown theme key "nope-500" for background color utility in className literal.

If the warning appears, Vela is set up. Delete the file and sync out/ into Studio with Rojo as usual. No Vela-specific Rojo mapping is needed.

No warning? See Troubleshooting.

Install the editor extension

The build doesn’t catch everything. For example, text-* on a frame compiles cleanly but does nothing. The language server flags these as you type. In VS Code, install Vela Roblox IntelliSense:

Terminal window
code --install-extension astra-void.vela-rbxts-lsp

For other editors, see Editor setup.

Next steps

  • Your first component: build a panel and see what each class compiles to.
  • The playground: try class names in the browser, no project needed.
  • Vide: what changes when you use Vide instead of React.