Rich Text Markup

UI rich text utilizes simple markup tags to style sections of a string in bold, italics, underline, fill color, stroke variations, and more. You can apply styling tags to TextLabel, TextButton, and TextBox objects.

Enabling Rich Text

You must enable rich text on a per-object basis through its RichText property in the Properties window, or by setting the property to true in a LocalScript.

1local gameTitle ="TextLabel")
2gameTitle.RichText = true
4gameTitle.Text = "Use a <b>bold title</b>"

Supported Tags

Rich text tags are similar to XML/HTML tags and you must include both an opening and closing tag around the formatted text.

<b>Formatted Text</b>

You can also nest tags inside each other as long as you close them in the reverse order of how you opened them.

<b><i><u>Formatted Text</u></i></b>

Formatting Tag Examples
Color <font color="">

I want the <font color="#FF7800">orange</font> candy.

I want the <font color="rgb(255,125,0)">orange</font> candy.

Size <font size="">

<font size="40">This is big.</font> <font size="20">This is small.</font>

Font Face¹ <font face="">

<font face="Michroma">This appears in Michroma face.</font>

Font Family¹ <font family="">

<font family="rbxasset://fonts/families/Michroma.json">This appears in Michroma face.</font>

Font Weight² <font weight="">

This is normal. <font weight="heavy">This is heavy.</font>

Stroke³ <stroke>

You won <stroke color="#00A2FF" joins="miter" thickness="2" transparency="0.25">25 gems</stroke>.

Transparency <font transparency="">

Text at <font transparency="0.5">50% transparency</font>.

Bold <b>

Text in <b>bold</b>.

Italic <i>

Text <i>italicized</i>.

Underline <u>

Text <u>underlined</u>.

Strikethrough <s>

Text with <s>strikethrough</s> applied.

Line Break <br />

Line break occurs after this sentence.<br />Next sentence...

Uppercase <uppercase>

<uppercase>Uppercase</uppercase> makes words read loudly!

<uc>Uppercase</uc> makes words read loudly!

Small Caps <smallcaps>

My name is <smallcaps>Diva Dragonslayer</smallcaps>.

My name is <sc>Diva Dragonslayer</sc>.

Comment <!-- -->

After this is a comment...<!--This does not appear in the final text--> and now more text...

¹ Font face/family names can be found on the Font enum reference page.

² Font weight can be a case-insensitive string name including Thin, ExtraLight, Light, Regular, Medium, SemiBold, Bold, ExtraBold, or Heavy; it can also be a number in factors of 100 between 100 and 900.

³ See UIStroke for details on <stroke> tag parameters such as joins and thickness.

Escape Forms

If you want to render certain characters like < or > and exempt them from consideration as part of rich text tags, you can write them in their escape form.

Character Escape Form Example Result
< &lt; 10 &lt; 100 10 < 100
> &gt; 100 &gt; 10 100 > 10
" &quot; Meet &quot;Diva Dragonslayer&quot; Meet "Diva Dragonslayer"
' &apos; Diva&apos;s pet is a falcon! Diva's pet is a falcon!
& &amp; Render another escape form <b>&amp;lt;</b> by escaping an ampersand Render another escape form &lt; by escaping an ampersand