Struct tui::widgets::Paragraph[][src]

pub struct Paragraph<'a, 't, T> where
    T: Iterator<Item = &'t Text<'t>>, 
{ /* fields omitted */ }

A widget to display some text.

Examples

let text = [
    Text::raw("First line\n"),
    Text::styled("Second line\n", Style::default().fg(Color::Red))
];
Paragraph::new(text.iter())
    .block(Block::default().title("Paragraph").borders(Borders::ALL))
    .style(Style::default().fg(Color::White).bg(Color::Black))
    .alignment(Alignment::Center)
    .wrap(true);

Methods

impl<'a, 't, T> Paragraph<'a, 't, T> where
    T: Iterator<Item = &'t Text<'t>>, 
[src]

Trait Implementations

impl<'a, 't, T> Widget for Paragraph<'a, 't, T> where
    T: Iterator<Item = &'t Text<'t>>, 
[src]

Draws the current state of the widget in the given buffer. That the only method required to implement a custom widget. Read more

Helper method to quickly set the background of all cells inside the specified area.

Helper method that can be chained with a widget's builder methods to render it.

Auto Trait Implementations

impl<'a, 't, T> Send for Paragraph<'a, 't, T> where
    T: Send

impl<'a, 't, T> Sync for Paragraph<'a, 't, T> where
    T: Sync