Raxol. UI. Components. Display. Text
(Raxol v2.6.1)
View Source
Styled text rendering with wrapping, alignment, and truncation.
Display-only widget -- no keyboard handling.
Props:
content(string) -- text to displaywrap(:word | :char | :none) -- wrapping mode, default:nonewhite_space(:normal | :nowrap | :pre | :pre_wrap | :pre_line) -- CSSwhite-space-following collapse/preserve/wrap semantics, default:normal. Only takes effect when set to a value other than:normal; at the default it defers entirely to the legacywrapprop so existing callers see zero behavior change. SeeRaxol.UI.TextLayoutfor the unified wrapping implementation.align(:left | :center | :right) -- alignment within width, default:leftwidth(integer | nil) -- constraint for wrapping/alignment/truncationtruncate(boolean) -- truncate with ellipsis when exceeding width, defaultfalsetext_overflow(:clip | :ellipsis) -- CSStext-overflow-following single-line truncation, default:clip(a no-op; existing rendering already visually clips at the buffer edge). Only takes effect whenwhite_spaceis:nowrapor:pre(the CSS-spec-following non-wrapping cases) and set to:ellipsis; at any other combination it defers entirely, so existing callers see zero behavior change. SeeRaxol.UI.TextLayout.truncate/3.line_clamp(pos_integer | nil) -- CSS Overflow Module Level 4line-clamp: caps wrapped output at this many lines, block-ellipsing the last kept line, defaultnil(a no-op). When set, it overrides the legacywrap/truncatedispatch entirely and wraps viawhite_space(default:normal) throughRaxol.UI.TextLayout.clamp/4.style,theme,id-- standard
Summary
Functions
Callback implementation for Raxol.UI.Components.Base.Component.handle_event/3.
Callback implementation for Raxol.UI.Components.Base.Component.mount/1.
Callback implementation for Raxol.UI.Components.Base.Component.unmount/1.
Callback implementation for Raxol.UI.Components.Base.Component.update/2.
Types
@type t() :: %{ id: String.t() | atom(), content: String.t(), wrap: :word | :char | :none, white_space: Raxol.UI.TextLayout.white_space(), align: :left | :center | :right, width: non_neg_integer() | nil, truncate: boolean(), text_overflow: :clip | :ellipsis, line_clamp: pos_integer() | nil, text_wrap: :auto | :pretty, style: map(), theme: map() }
Functions
Callback implementation for Raxol.UI.Components.Base.Component.handle_event/3.
Callback implementation for Raxol.UI.Components.Base.Component.mount/1.
Callback implementation for Raxol.UI.Components.Base.Component.unmount/1.
Callback implementation for Raxol.UI.Components.Base.Component.update/2.