Raxol.Core.Renderer.View.Components.Text (Raxol v0.3.0)

View Source

Handles text rendering for the Raxol view system. Provides text styling, wrapping, and alignment functionality.

Summary

Functions

Creates a new text view.

Renders text with the given options and width.

Functions

new(content, opts \\ [])

Creates a new text view.

Options

  • :fg - Foreground color
  • :bg - Background color
  • :style - List of style atoms (e.g., [:bold, :underline])
  • :align - Text alignment (:left, :center, :right)
  • :wrap - Text wrapping mode (:none, :char, :word)

Examples

Text.new("Hello, World!", fg: :red, style: [:bold])
Text.new("Centered text", align: :center)

render(text, width)

Renders text with the given options and width.