Skip to content

Text

Text shows text in one of the type scales of the theme. It sizes itself to fit the text.

Usage

Call Components.Text with a scope and a table of properties:

C.Text(scope, {
    Text = "Recent activity",
    Variant = "Title", -- (1)!
})
  1. Variant is a key of theme.Typography: "Display", "Headline", "Title", "Button", "Body", "Label" or "Mono", or one you added with Theme.create. If the name does not exist, the component uses "Body".

Properties

Name Type Required Default Description
Theme ThemeRef ❌ The contextual theme Theme to use for this component instead of the one from Theme.Provide.
LayoutOrder UsedAs<number> ❌ 0 Position in a parent UIListLayout or UIGridLayout.
Size UsedAs<UDim2> ❌ - Size of the component.
Visible UsedAs<boolean> ❌ true Whether the component is shown.
ZIndex UsedAs<number> ❌ - Z index of the component.
Text UsedAs<string> ✅ - The text to show.
Variant TextVariant ❌ "Body" Type scale to use.
Color UsedAs<Color3> ❌ Colors.OnSurface Colour of the text.
TextXAlignment Enum.TextXAlignment ❌ Enum.TextXAlignment.Left Horizontal alignment of the text.
TextWrapped boolean ❌ false Wrap the text onto several lines. The text needs a fixed width to wrap, from Size or from its parent.

See also