Skip to main content

println

Function println 

Source
pub fn println(message: impl IntoPrintable)
Expand description

Print a message that persists above the UI (like Bubbletea’s Println).

In inline mode, this clears the current UI, writes the message, and the UI is re-rendered below it. The message stays in terminal history.

In fullscreen mode, this is a no-op (messages are ignored, like Bubbletea).

Fallback behavior: If no rnk app is running, the message is printed directly to stdout (using render_to_string_auto for Elements).

Supports both plain text and rendered elements:

§Examples

use rnk::println;

// Simple text
rnk::println("Task completed successfully!");
rnk::println(format!("Downloaded {} files", count));

// Complex components
let banner = Box::new()
    .border_style(BorderStyle::Round)
    .padding(1)
    .child(Text::new("Welcome!").bold().into_element())
    .into_element();
rnk::println(banner);