value

Styled text value for terminal output.

struct Component

source

pub struct Component

A styled text value, typically paired with a Label in detail views.

Field Type Description
style Style Style painted over the whole text.
text String Text shown as is, with no padding or truncation.

Implements Display.

Component::new

source

pub fn new(text: impl Into<String>, style: Style) -> Self

Create a value with the given display text and style.

Parameter Type Description
text impl Into<String> the text to show
style Style the style to paint it in
returns Self The value, ready to display.