Skip to Content
WidgetsParagraph

Paragraph

Paragraph is the standard widget for longer text.

Paragraph
Paragraph terminal preview
Terminal preview of Paragraph

Smallest example

let body = Paragraph::new("Ansiq keeps a retained UI tree.") .wrap(Wrap { trim: true }) .build();

Use Paragraph when

  • text may wrap
  • alignment matters
  • you want a Block around the text
  • vertical or horizontal scroll offsets matter

Key builder methods

  • Paragraph::new(...)
  • .wrap(...)
  • .alignment(...)
  • .scroll((y, x))
  • .block(...)
  • .style(...)

Common combinations

  • Paragraph + Block for docs-like panels
  • Paragraph + ScrollView for long help text

Where to see it in examples

Last updated on