pub struct ParagraphExt<'a> { /* private fields */ }Expand description
Extended paragraph widget with word-wrapping and scrolling.
Unlike ratatui’s Paragraph, this widget:
- Does not pad lines with trailing spaces
- Provides fine-grained control over word wrapping
- Preserves per-character styling through wrapping
- Supports vertical scrolling
Implementations§
Source§impl<'a> ParagraphExt<'a>
impl<'a> ParagraphExt<'a>
Sourcepub fn scroll(self, scroll: u16) -> Self
pub fn scroll(self, scroll: u16) -> Self
Set the vertical scroll offset (number of wrapped lines to skip).
Sourcepub fn width(self, width: u16) -> Self
pub fn width(self, width: u16) -> Self
Set the width for word wrapping.
If not set, the render area width will be used.
Sourcepub fn line_count(&self, width: u16) -> usize
pub fn line_count(&self, width: u16) -> usize
Calculate the total number of wrapped lines.
This is useful for calculating scroll bounds.
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for ParagraphExt<'a>
impl<'a> RefUnwindSafe for ParagraphExt<'a>
impl<'a> Send for ParagraphExt<'a>
impl<'a> Sync for ParagraphExt<'a>
impl<'a> Unpin for ParagraphExt<'a>
impl<'a> UnwindSafe for ParagraphExt<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more