TermUI.Widget.Label (TermUI v0.2.0)

View Source

A stateless widget for displaying text.

Label is the simplest widget - it renders text with optional styling, alignment, wrapping, and truncation.

Usage

Label.render(%{text: "Hello, World!"}, area)

Label.render(%{
  text: "Centered text",
  align: :center,
  style: %{fg: :blue, bold: true}
}, area)

Props

  • :text - The text to display (required)
  • :align - Text alignment: :left, :center, :right (default: :left)
  • :wrap - Whether to wrap text (default: false)
  • :truncate - Whether to truncate with ellipsis (default: true)
  • :style - Style options (fg, bg, bold, etc.)

Summary

Functions

Returns a description of this component.

Renders the label text within the given area.

Functions

describe()

Returns a description of this component.

render(props, area)

Renders the label text within the given area.