class RatatuiRuby::Text::Line
A sequence of styled spans.
Words form sentences. Spans form lines.
This class composes multiple {Span} objects into a single horizontal row of text. It handles the layout of rich text fragments within the flow of a paragraph.
Use it to build multi-colored headers, status messages, or log entries.
Examples
Text::Line.new( spans: [ Text::Span.styled("User: ", Style.new(modifiers: [:bold])), Text::Span.styled("kerrick", Style.new(fg: :blue)) ] )
Attributes
Alignment within the container.
:left, :center, or :right.
Public Class Methods
Source
# File lib/ratatui_ruby/schema/text.rb, line 119 def self.from_string(content, alignment: nil) new(spans: [Span.new(content:, style: nil)], alignment:) end
Creates a simple line from a string.
Text::Line.from_string("Hello")
Source
# File lib/ratatui_ruby/schema/text.rb, line 112 def initialize(spans: [], alignment: nil) super end