Skip to main content

Module group

Module group 

Source
Expand description

Group renderable for combining multiple renderables.

A Group combines multiple renderables into a single unit that can be passed to containers like Panel or Layout. This is useful when you want to pass multiple renderables as panel content.

§Examples

use rich_rust::renderables::{Group, Panel, Rule};
use rich_rust::text::Text;

// Combine multiple renderables into a group
let group = Group::new()
    .push("First paragraph of text")
    .push(Rule::new())
    .push("Second paragraph");

// Use the group as panel content
let panel = Panel::from_renderable(&group, 80)
    .title("Grouped Content");

// Or render directly
console.print_renderable(&group);

§Fit Option

By default, each renderable is rendered on its own lines. Use fit(true) to attempt to render items inline when they fit.

Structs§

Group
A container that groups multiple renderables together.

Functions§

group
Create a group from an iterator of renderables.