Most projects import only defineConfig, and register vela-rbxts/transformer in tsconfig.json.
This page lists everything else.
pnpm add vela-rbxtsnpm install vela-rbxtsyarn add vela-rbxtsbun add vela-rbxtsFrom vela-rbxts
import { defaultConfig, defineConfig, definePreset, plugin, createTransformer, type TailwindConfig, type TailwindConfigInput, type VelaPreset, type ThemeScreens, type VariantDefinition, type ClassValue, type StylableProps,} from "vela-rbxts";| Export | Kind | What it is |
|---|---|---|
defineConfig | function | Resolves a config against the defaults |
defaultConfig | value | The resolved built-in theme |
definePreset | function | Types a preset without resolving it |
plugin | function | Wraps a plugin handler, with an optional name |
createTransformer | function | The rbxtsc host bridge, for tooling |
| Types | types | Config, preset, plugin, variant and className types |
The plugin and variant types come from @vela-rbxts/config, re-exported here so you don’t need to
install it.
defineConfig
function defineConfig(input?: TailwindConfigInput): TailwindConfig;Resolves your config against the built-in defaults. defineConfig() with no argument returns a fresh
copy of defaultConfig. It’s available in vela.config.ts even without the import.
defaultConfig
const defaultConfig: TailwindConfig;The built-in theme Vela uses when there is no config: 28 color families, ten named radius keys plus
DEFAULT, and one spacing key.
createTransformer
function createTransformer( options?: RbxtscTransformerBridgeOptions,): RbxtscTransformerBridge;
// the returned bridge:// { name, getFileEligibility, shouldTransformFile, transformSource, transformFile }Returns the rbxtsc host bridge. Its name is "@vela-rbxts/rbxtsc-host". transformSource and
transformFile are the same function. You only need this for tooling that runs the transform itself.
tsconfig.json needs vela-rbxts/transformer. Passing this createTransformer to roblox-ts transforms nothing, with no error.
Types
| Prop | Type | Description |
|---|---|---|
| TailwindConfig | { preflight; framework; theme: { colors; radius; spacing; fontFamily; screens; rem }; plugins } | A fully resolved config, every field present. What defineConfig returns and the compiler consumes. |
| TailwindConfigInput | { presets?; preflight?; framework?; theme?: { …; extend?: { … } }; plugins? } | What you pass to defineConfig. Everything is optional, and theme has an extend branch. |
| VelaPreset | TailwindConfigInput | A shareable slice of config. Same shape as defineConfig's input. Type one with definePreset() so it merges as an input, not a finished config. |
| ThemeScreens | Record<string, number> | Breakpoint widths in pixels, as in theme.screens. |
| VariantDefinition | { attribute: string; equals: string | number | boolean } | A project-defined variant. It matches while the instance has that Roblox attribute with that value. |
| ClassValue | string | number | boolean | null | undefined | Record<string, boolean | null | undefined> | ClassValue[] | What the className prop accepts, including the conditional object and nested array forms. |
| StylableProps | StylableProps<P = unknown> | Your props P plus { className?: ClassValue }. Use it on a component that forwards className. |
The root also re-exports the rest of the plugin API’s types: AttributeVariant,
VariantAttributeValue, PluginVariants, MotionDriver, PluginApi, PluginHandler,
PluginPropMap, PluginUtilities, PluginUtilityValue, ResolvedPlugins, ResolvedPluginsInput
and VelaPlugin.
The global augmentation
Importing vela-rbxts adds className to every element:
declare global { namespace React { interface Attributes { className?: ClassValue; } } namespace Vide { interface Attributes { className?: ClassValue | (() => ClassValue); } }}It only applies once something in your program imports the package. Use a one-line .d.ts:
import "vela-rbxts";Some helpers in @vela-rbxts/config are not re-exported from the root. Import them from
@vela-rbxts/config directly, and expect them to change more often:
- Functions and constants:
SHADES,PALETTE_DEFAULT_KEY,resolveThemeColors,mergeColorRegistry,normalizeColorRegistry,normalizeColorScale. - Types:
Shade,PaletteKey,PaletteDefaultKey,ThemeScale,ColorPalette,ColorValue,ColorScaleInput,ThemeColors,ColorInputMap,ThemeConfig,ThemeConfigInput.
From vela-rbxts/transformer
The program transformer roblox-ts loads. Register it in tsconfig.json:
{ "compilerOptions": { "plugins": [{ "transform": "vela-rbxts/transformer" }] }}It’s a CommonJS module whose export is the transformer factory. .createTransformer,
.createRbxtsTailwindProgramTransformer and .default all point to the same function. It throws if
roblox-ts doesn’t pass it a TypeScript instance. Options are in
Configuration.
Published packages
Install vela-rbxts and the VS Code extension. Everything else arrives as a dependency.
| Package | What it is | Install directly? |
|---|---|---|
vela-rbxts | Config helpers, types, the global augmentation, the transformer subpath, and the vela CLI | Yes. The only one an app installs |
@vela-rbxts/compiler | The Rust compiler as an N-API addon: transform, completions, hover, diagnostics, colors, inlay hints, sorting | No, a dependency |
@vela-rbxts/compiler-wasm | The same compiler as WebAssembly, for places the native addon can’t load, such as a browser | Only to compile outside Node |
@vela-rbxts/config | The theme schema, defineConfig, defaultConfig, and the color helpers | Only for a helper the root doesn’t re-export |
@vela-rbxts/core | Shared constants, including the supported host element tags | No. Nothing depends on it either |
@vela-rbxts/ir | The style representation shared by the compiler and its consumers | No |
@vela-rbxts/types | Shared TypeScript types | No |
@vela-rbxts/rbxtsc-host | The roblox-ts adapter: file eligibility, config discovery, diagnostic mapping, and sortSourceForHost, which vela sort runs on | No |
@rbxts/vela-runtime-core | The shared runtime: resolution, theme, rem math, rich text, margin and divide | No, comes with each runtime host |
@rbxts/vela-runtime | The React runtime host, one ModuleScript shared by the place | No, ships with vela-rbxts |
@rbxts/vela-runtime-vide | The Vide runtime host, used when the project targets Vide | No, ships with vela-rbxts |
@vela-rbxts/lsp | The language server and its platform packages | Only for an editor other than VS Code |
vela-rbxts-lsp | The VS Code extension, Vela Roblox IntelliSense, published as a VSIX, not to npm | Install astra-void.vela-rbxts-lsp from the marketplace |
All packages share one version, currently 0.15.0. The VS Code extension ships with each release,
but the marketplace lists it under a date-based build number, such as 2026.11.4001.
Don’t mix versions across Vela’s packages. A runtime at a different version from the compiler fails the build with runtime-not-installed.
The @rbxts/vela-runtime* packages are the only Vela code that reaches your place. They live under
@rbxts so roblox-ts and Rojo find them with no config change. With pnpm, hoist that scope
(installation). Each runtime host
lists its UI library as an optional peer, so a Vide project never installs React. The host you don’t
use is an unused ModuleScript.
vela-rbxts installs the CLI as two commands, vela and
vela-rbxts. They are the same.
Public subpaths
| Subpath | What it exposes |
|---|---|
@vela-rbxts/rbxtsc-host/project-config | Config discovery and loading, used by the VS Code extension. Also projectConfigDependencies(sourceFileName): every file a source file’s config was built from, including vela.css and its imports |
@vela-rbxts/compiler/native | The raw N-API binding |
Both of those packages also export ./package.json. vela-rbxts ships a schema.json for the
config. Point a vela.config.json’s $schema at ./node_modules/vela-rbxts/schema.json.
Version requirements
| Tool | Tested version |
|---|---|
| Node | 24 (what CI runs) |
| TypeScript | 5.9.3 (6.x also builds, 7 does not) |
| roblox-ts | ^3.0.0 |
@rbxts/react | ^17.3.7-ts.1 |
@rbxts/services | ^1.6.0 |
@rbxts/types | ^1.0.958, the first with UIBlur |
| VS Code | ^1.91.0, the extension’s only engines entry |
No package declares TypeScript or roblox-ts as a peer, so a wrong version shows up only as a build failure.
TypeScript is an upper bound as well as a floor. Vela calls your project’s TypeScript directly, not
the copy roblox-ts pins for itself. TypeScript 7 fails on the first file with
compiler-invocation-failed: Cannot read properties of undefined (reading 'Latest').
The React range is narrower than it looks. A caret on a prerelease only matches prereleases of
17.3.7, so the current latest, 17.3.13-ts.1, is outside it. Under npm that nests the runtime
and fails the build with runtime-not-installed. See
installation.
@rbxts/services is needed at runtime. The runtime reads UserInputService and Workspace from it
to evaluate variants.
Prebuilt compiler binaries
The compiler ships native binaries for:
x86_64-unknown-linux-gnux86_64-unknown-linux-muslaarch64-unknown-linux-gnuaarch64-apple-darwinx86_64-apple-darwinx86_64-pc-windows-msvc
Windows on ARM (aarch64-pc-windows-msvc) and linux arm64 musl have no binary. Build the compiler
crate from source there.
On an unsupported platform the loader fails with Cannot find native binding. Reinstalling won’t help, whatever the message says.
The loader’s last fallback looks for @vela-rbxts/compiler-wasm32-wasi, which isn’t published.
@vela-rbxts/compiler-wasm is a separate package with its own API, not a drop-in replacement.
The compiler’s sourceMap option
transform(source, { configJson, sourceMap: true });With sourceMap: true, the result also has mappings: a flat, sorted array of
[genLine, genCol, origLine, origCol] entries, 0-based, with UTF-16 columns.
vela build turns these into the maps under
.vela/maps. Leave it off unless you write the output to disk.
See also
- Configuration: the schema
defineConfigaccepts. - Diagnostics: what the transformer reports.