ELLIPSIS

Constant ELLIPSIS 

Source
pub const ELLIPSIS: &str = "…";
Expand description

Unicode ellipsis character (…) used for truncated content display.

This constant provides a consistent ellipsis symbol for indicating truncated text in list items, headers, and other UI elements when content exceeds the available display width.

§Usage

The ellipsis is commonly used for:

  • Truncating long item titles or descriptions
  • Indicating overflow in fixed-width displays
  • Showing partial content in constrained layouts

§Examples

use bubbletea_widgets::list::style::ELLIPSIS;

// Simulate text truncation
let long_text = "This is a very long text that needs truncation";
let max_width = 20;

let truncated = if long_text.len() > max_width {
    format!("{}{}", &long_text[..max_width-1], ELLIPSIS)
} else {
    long_text.to_string()
};

println!("{}", truncated); // "This is a very lon…"