mirror of
https://github.com/ratatui-org/ratatui
synced 2024-11-10 07:04:17 +00:00
docs(Text): add overview of the relevant methods (#857)
Add an overview of the relevant methods under `Constructor Methods`, `Setter Methods`, and `Other Methods` subtitles.
This commit is contained in:
parent
a489d85f2d
commit
6ecaeed549
1 changed files with 20 additions and 0 deletions
|
@ -24,6 +24,26 @@ use crate::{prelude::*, widgets::Widget};
|
|||
/// Usually apps will use the [`Paragraph`] widget instead of rendering a `Text` directly as it
|
||||
/// provides more functionality.
|
||||
///
|
||||
/// # Constructor Methods
|
||||
///
|
||||
/// - [`Text::default`] creates a `Text` with empty content and the default style.
|
||||
/// - [`Text::raw`] creates a `Text` (potentially multiple lines) with no style.
|
||||
/// - [`Text::styled`] creates a `Text` (potentially multiple lines) with a style.
|
||||
///
|
||||
/// # Setter Methods
|
||||
///
|
||||
/// These methods are fluent setters. They return a `Text` with the property set.
|
||||
///
|
||||
/// - [`Text::style`] sets the style of this `Text`.
|
||||
/// - [`Text::alignment`] sets the alignment for this `Text`.
|
||||
///
|
||||
/// # Other Methods
|
||||
///
|
||||
/// - [`Text::width`] returns the max width of all the lines.
|
||||
/// - [`Text::height`] returns the height.
|
||||
/// - [`Text::patch_style`] patches the style of this `Text`, adding modifiers from the given style.
|
||||
/// - [`Text::reset_style`] resets the style of the `Text`.
|
||||
///
|
||||
/// [`Paragraph`]: crate::widgets::Paragraph
|
||||
/// [`Widget`]: crate::widgets::Widget
|
||||
///
|
||||
|
|
Loading…
Reference in a new issue