@anton.matosov/roact

1.0.0 • Public • Published

Roact

A declarative UI library for Roblox Lua inspired by React.
 

Installation

Method 1: Model File (Roblox Studio)

  • Download the rbxmx 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 lib directory into your codebase
  • Rename the folder to Roact
  • Use a plugin like Rojo to sync the files into a place

Usage

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 for details.

Readme

Keywords

Package Sidebar

Install

npm i @anton.matosov/roact

Weekly Downloads

1

Version

1.0.0

License

Apache-2.0

Unpacked Size

197 kB

Total Files

82

Last publish

Collaborators

  • anton.matosov