class RatatuiRuby::Text::Span

A styled string fragment.

Text is rarely uniform. You need to bold a keyword, colorize an error, or dim a timestamp.

This class attaches style to content. It pairs a string with visual attributes.

combine spans into a {Line} to create rich text.

Examples

Text::Span.new(content: "Error", style: Style.new(fg: :red, modifiers: [:bold]))