Skip to content

Examples

The examples/ directory has side-by-side input/output pairs showing specific features. Each .ts/.tsx file has a matching .luau file showing the compiled output.

ExampleFeatures shown
react-componentuseState, useCallback, JSX, props, element mapping
async-awaitasync/await to Promise transform
decoratorsClass and method decorators
flowGenerator functions, coroutine adapter
optional-chaining?., ??, temp-var extraction
regexRegExp literals and methods
roblox-services@rbx-services, Instance API, : method calls
typesInterfaces, type aliases, generics, enums

The demo/ directory contains a full Roblox project that demonstrates rbx-tsx in a real setup:

  • Rojo project configuration (default.project.json)
  • Wally package manager config for React and ReactRoblox dependencies
  • Source TypeScript files and their compiled Luau output
  • Build scripts for both Windows and Unix