Text display -- renders static text.
Props
content(string) -- the text string to display.size(number) -- font size in pixels.color(color) -- text color. SeeToddy.Iced.Color.font(string | map) -- font specification. SeeToddy.Iced.Font.width(length) -- text widget width. SeeToddy.Iced.Length.height(length) -- text widget height.line_height(number | map) -- line height. Number is a relative multiplier; map with%{relative: n}or%{absolute: n}for explicit control.align_x(atom) -- horizontal text alignment::left,:center,:right. SeeToddy.Iced.Alignment.align_y(atom) -- vertical text alignment::top,:center,:bottom. SeeToddy.Iced.Alignment.wrapping(atom) -- text wrapping::none,:word,:glyph,:word_or_glyph. SeeToddy.Iced.Wrapping.ellipsis(string) -- text ellipsis mode:"none","start","middle","end". Truncates text that overflows and inserts an ellipsis character at the given position.style(atom) -- named style. One of::default,:primary,:secondary,:success,:danger,:warning.shaping(atom) -- text shaping strategy::basicor:advanced. SeeToddy.Iced.Shaping.a11y(map) -- accessibility overrides. SeeToddy.Iced.A11y.
Summary
Functions
Sets accessibility annotations.
Sets the horizontal text alignment.
Sets the vertical text alignment.
Converts this text struct to a ui_node() map via the Toddy.Iced.Widget protocol.
Sets the text color.
Sets the text ellipsis mode. One of: "none", "start", "middle", "end".
Sets the font.
Sets the text widget height.
Sets the line height.
Creates a new text widget struct with the given content and optional keyword opts.
Sets the text shaping strategy.
Sets the font size in pixels.
Sets the text style.
Sets the text widget width.
Applies keyword options to an existing text struct.
Sets the text wrapping mode.
Types
@type option() :: {:size, number()} | {:color, Toddy.Iced.Color.input()} | {:font, Toddy.Iced.Font.t()} | {:width, Toddy.Iced.Length.t()} | {:height, Toddy.Iced.Length.t()} | {:line_height, number() | map()} | {:align_x, Toddy.Iced.Alignment.t()} | {:align_y, Toddy.Iced.Alignment.t()} | {:wrapping, Toddy.Iced.Wrapping.t()} | {:ellipsis, String.t()} | {:shaping, Toddy.Iced.Shaping.t()} | {:style, style()} | {:a11y, Toddy.Iced.A11y.t()}
@type preset() :: :warning | :danger | :success | :secondary | :primary | :default
@type style() :: preset()
@type t() :: %Toddy.Iced.Widget.Text{ a11y: Toddy.Iced.A11y.t() | nil, align_x: Toddy.Iced.Alignment.t() | nil, align_y: Toddy.Iced.Alignment.t() | nil, color: Toddy.Iced.Color.t() | nil, content: String.t(), ellipsis: String.t() | nil, font: Toddy.Iced.Font.t() | nil, height: Toddy.Iced.Length.t() | nil, id: String.t(), line_height: number() | map() | nil, shaping: Toddy.Iced.Shaping.t() | nil, size: number() | nil, style: style() | nil, width: Toddy.Iced.Length.t() | nil, wrapping: Toddy.Iced.Wrapping.t() | nil }
Functions
@spec a11y(text :: t(), a11y :: Toddy.Iced.A11y.t()) :: t()
Sets accessibility annotations.
@spec align_x(text :: t(), align_x :: Toddy.Iced.Alignment.t()) :: t()
Sets the horizontal text alignment.
@spec align_y(text :: t(), align_y :: Toddy.Iced.Alignment.t()) :: t()
Sets the vertical text alignment.
@spec build(text :: t()) :: Toddy.Iced.ui_node()
Converts this text struct to a ui_node() map via the Toddy.Iced.Widget protocol.
@spec color(text :: t(), color :: Toddy.Iced.Color.input()) :: t()
Sets the text color.
Sets the text ellipsis mode. One of: "none", "start", "middle", "end".
@spec font(text :: t(), font :: Toddy.Iced.Font.t()) :: t()
Sets the font.
@spec height(text :: t(), height :: Toddy.Iced.Length.t()) :: t()
Sets the text widget height.
Sets the line height.
Creates a new text widget struct with the given content and optional keyword opts.
@spec shaping(text :: t(), shaping :: Toddy.Iced.Shaping.t()) :: t()
Sets the text shaping strategy.
Sets the font size in pixels.
Sets the text style.
@spec width(text :: t(), width :: Toddy.Iced.Length.t()) :: t()
Sets the text widget width.
Applies keyword options to an existing text struct.
@spec wrapping(text :: t(), wrapping :: Toddy.Iced.Wrapping.t()) :: t()
Sets the text wrapping mode.