How would I make a tool-tip sized to text? (4.6 GUI)

I want to make a mouseover tool-tip a la World of Warcraft for items.
Problem is, I don’t know how much text a description will be until runtime when I load objects and the player starts mousing over things!

For this to work, it’d need a background (image, panel, whatever) and the text that goes on top of it. Resizing and positioning said background would be a breeze, once I know the text width/height.

Is this possible with the text box created from Ui > Text? Some alternative?

Apply a Content Size Fitter and a Horizontal Layout Group to the parent panel, and set the Content Size Fitter component’s settings both to “Preferred Size”. This makes it resize (with optional padding) to fit the preferred size of whatever its contents are. You can use Layout Element nodes on the contents as well to influence that target size, but usually you don’t want to.

Why don’t you use string.Length to get the number of characters in your text, then derive your box size from that?