Skip to content
This repository was archived by the owner on Dec 13, 2023. It is now read-only.

Roblox/roact

Folders and files

NameName
Last commit message
Last commit date

Latest commit

1676d95 · Dec 13, 2023
Jan 30, 2023
Sep 25, 2021
Sep 25, 2021
Oct 23, 2021
Sep 25, 2021
Sep 16, 2021
Jun 10, 2022
May 3, 2019
Sep 25, 2021
Mar 13, 2018
May 3, 2019
Jun 10, 2022
Jun 13, 2022
Sep 25, 2021
May 3, 2019
Dec 13, 2023
Aug 12, 2019
May 3, 2019
Jun 10, 2022
Oct 23, 2021
Sep 16, 2021
Jun 13, 2022
Sep 25, 2021
Jun 10, 2022
Sep 25, 2021
Jan 31, 2022

Repository files navigation

This repository is deprecated and no longer maintained.

See react-lua for our currently maintained React in Lua library.

Roact

GitHub Actions Build Status Coveralls Coverage Documentation
A declarative UI library for Roblox Lua inspired by React.
 

Installation

Method 1: Model File (Roblox Studio)

  • Download the rbxm model file attached to the latest release from the GitHub releases page.
  • Insert the model into Studio into a place like ReplicatedStorage

Method 2: Filesystem

  • Copy the src directory into your codebase
  • Rename the folder to Roact
  • Use a plugin like Rojo to sync the files into a place

For a detailed guide and examples, check out the official Roact documentation.

local LocalPlayer = game:GetService("Players").LocalPlayer

local Roact = require(Roact)

-- Create our virtual tree describing a full-screen text label.
local tree = Roact.createElement("ScreenGui", {}, {
	Label = Roact.createElement("TextLabel", {
		Text = "Hello, world!",
		Size = UDim2.new(1, 0, 1, 0),
	}),
})

-- Turn our virtual tree into real instances and put them in PlayerGui
Roact.mount(tree, LocalPlayer.PlayerGui, "HelloWorld")

License

Roact is available under the Apache 2.0 license. See LICENSE.txt for details.