Codectionary / Developer documentation / Luau

TextLabel

Display non-editable text in an interface.

Why use TextLabel?

TextLabel presents instructions, scores, and status messages. It is visual output rather than an input control.

Try it in Roblox Studio

Add a ScreenGui named PracticeGui to StarterGui and place this LocalScript inside it. Run a Studio client to see the label.

Syntax

label.Text = "Ready"

Examples

TextLabel

Show a readable status label.

local screenGui = script.Parent
assert(screenGui:IsA("ScreenGui"))
local label = Instance.new("TextLabel")
label.Size = UDim2.fromOffset(240, 48)
label.Position = UDim2.fromOffset(24, 24)
label.BackgroundTransparency = 1
label.TextColor3 = Color3.fromRGB(245, 245, 245)
label.Text = "Ready to play"
label.Parent = screenGui
  1. Text stores the words shown to the player.
  2. Size and Position determine where the label appears; BackgroundTransparency hides the rectangle behind it.
  3. TextColor3 affects readability, especially when the game scene behind the transparent label changes.

Best practices

  • Use concise text and adequate contrast.
  • Use TextButton for actions rather than making a label look clickable.

Runtime & versions

Luau host; Roblox engine examples require Roblox Studio. Feature availability depends on the language and runtime version used by your project; consult the official reference below.

Luau documentation

Specifications & further reading