Description
The Ellipsis
field is a member of the TextOverflow
enumeration within the Sandbox.UI
namespace. It specifies that when text overflows its container, the text should be truncated and replaced with an ellipsis ("...") to indicate that more text exists beyond the visible area.
Usage
Use the TextOverflow.Ellipsis
field when you want to apply an ellipsis to text that exceeds the bounds of its container. This is useful for maintaining a clean and readable UI when dealing with variable-length text content.
Example
// Example of using TextOverflow.Ellipsis in a UI component
var label = new Label();
label.Text = "This is a very long text that might not fit in the container.";
label.Style.Set("text-overflow", TextOverflow.Ellipsis);
label.Style.Set("overflow", "hidden");
label.Style.Set("white-space", "nowrap");