Katalyst Logo

Katalyst

New Element

Creating elements with Katalyst.New

Overview

Use Katalyst.New(className) to create UI elements. It returns a constructor that accepts a props table and returns a proxy wrapping a real Instance.

Example

local New = Katalyst.New
local label = New("TextLabel")({
  Text = "Hello",
})

-- or
local label = New "TextLabel" {
  Text = "Hello",
}

Notes

  • The proxy is callable to get the raw Instance: label().
  • Props that are State or functions are wired to update the Instance automatically.

On this page