Text
Text in the theme's fonts and colours: headings, body copy, muted notes and
labels. It wraps to fill its parent's width unless you ask it to fit the text.
handle.Instance is the TextLabel.

Lucy.Stack.new({
gap = "Space1",
children = {
Lucy.Text.new({ text = "Club Lucy", variant = "h1", align = "center" }),
Lucy.Text.new({ text = "DJ Lucy is on the decks tonight", variant = "lead", align = "center" }),
Lucy.Text.new({ text = "Now playing: Neon Nights, 124 BPM", variant = "muted", align = "center" }),
},
Parent = parent,
})
Props
| Prop | Type | Default | State key | What it does |
|---|---|---|---|---|
text | string | "" | yes | The text |
variant | string | "p" | yes | The style, see below |
align | string | "left" | yes | left, center or right |
visible | boolean | true | yes | Shows or hides it |
autoWidth | boolean or responsive | false | Sizes to the text instead of filling the width, and stops wrapping | |
wrap | boolean, responsive or getter | false keeps the text on one line, true wraps it. Left out, text that fills the width wraps and text sized to its words (autoWidth, reserve) does not | ||
fit | true or number | Keeps the text on one line, sized to its words, and scales it down when it is wider than its parent has room for, never under 0.6 of its size. A number sets that floor instead (fit = 0.5) | ||
reserve | string or getter | Holds the width of the widest text of this shape, so a timer or count never moves what is around it: "0:00" holds the widest time with any digits. Measured in the text's own font and size. Align it to say which side the number keeps to. Give a getter for a line whose words change too (return the line itself): it holds the widest for those words and only moves when the words do | ||
richText | boolean | false | Turns on Roblox rich text tags such as <b> | |
reveal | number or true | Types the text out, this many characters a second (true: 40), and again from the start whenever the text changes | ||
revealing | boolean | false | yes, read only | Whether it is typing out now |
value | number | yes | Shows this number instead of text, formatted by format | |
format | function | Lucy.Format.number | Turns value into text, such as function(n) return `+{n} XP` end | |
count | number or true | Counts up to value over this many seconds (true: 0.8), and on from where it is when it changes | ||
from | number | 0 | Where the first count starts | |
counting | boolean | false | yes, read only | Whether it is counting now |
It also takes the props every component takes.
| Variant | Use it for |
|---|---|
h1 to h4 | Headings, largest first |
p | Body text |
lead | A larger, softer opening line |
large | Text that should stand out |
small | Small print |
muted | Notes and hints, in a softer colour |
label | Labels for fields and settings |
Examples
A label that follows game state:

local coins = app.state:ref("player.coins")
Lucy.Text.new({
text = function() return `Coins: {coins()}` end,
variant = "h3",
Parent = hud,
})
Text that fits itself, for use in a row:

Lucy.Text.new({ text = "Level 12", variant = "small", autoWidth = true, Parent = row })
A word or a stat that must stay on one line in a narrow card. With fit it shrinks to the
card's width instead of breaking over two lines or running out of the card, and keeps its own
size whenever there is room. It measures against its parent, so put it straight in the card or
row whose width it should keep to:

local card = Lucy.new "Frame" {
Size = UDim2.fromOffset(110, 60),
BackgroundTransparency = 1,
Parent = parent,
}
Lucy.Text.new({ text = "OVERDRIVE", variant = "h2", fit = true, Parent = card })
Rich text:

Lucy.Text.new({ text = "Press <b>E</b> to dance", richText = true, Parent = prompt })
Text that types itself out, as a character's line in a dialogue box. The whole line is laid out
from the start, so words never jump to the next line as they appear. text:skipReveal() shows the
rest at once (a press to skip ahead), and text.Revealed fires once it is all out:
local line = Lucy.Text.new({
text = function() return speech() end,
variant = "lead",
reveal = 34,
Parent = dialogue,
})
line.Revealed:Connect(function()
nextButton:set("visible", true)
end)
A number that counts up to its value, such as XP on a results screen. It counts on from where it
is whenever the value changes, so a second reward adds to the first. text:skipCount() lands it at
once, and text.Counted fires when it lands:
local xp = app.state:ref("player.xp")
Lucy.Text.new({
value = xp,
count = true,
format = function(n)
return `{Lucy.Format.number(n)} XP`
end,
variant = "h2",
Parent = results,
})
Both are composables underneath, useReveal and useCount, so
anything else can type out or count up the same way.
Preview
In Studio, from the command bar: Lucy.Preview.show("Text"), and Lucy.Preview.show("TextMotion")
for the reveal and the count.