Keyed column layout -- arranges children vertically with stable identity keys.
Like Column, but uses each child's id as a key for iced's internal
widget diffing. This avoids unnecessary rebuilds when items are added,
removed, or reordered in dynamic lists.
Props
spacing(number) -- vertical space between children in pixels. Default: 0.padding(number | map) -- padding inside the column. SeeToddy.Iced.Padding.width(length) -- column width. Default: shrink. SeeToddy.Iced.Length.height(length) -- column height. Default: shrink.max_width(number) -- maximum width in pixels.a11y(map) -- accessibility overrides. SeeToddy.Iced.A11y.
Summary
Functions
Sets accessibility annotations.
Converts this keyed column struct to a ui_node() map via the Toddy.Iced.Widget protocol.
Appends multiple children to the keyed column.
Sets the column height.
Sets the maximum width in pixels.
Creates a new keyed column struct with optional keyword opts.
Sets the padding inside the column.
Appends a child to the keyed column.
Sets the spacing between children in pixels.
Sets the column width.
Applies keyword options to an existing keyed column struct.
Types
@type option() :: {:spacing, number()} | {:padding, Toddy.Iced.Padding.t()} | {:width, Toddy.Iced.Length.t()} | {:height, Toddy.Iced.Length.t()} | {:max_width, number()} | {:a11y, Toddy.Iced.A11y.t()}
@type t() :: %Toddy.Iced.Widget.KeyedColumn{ a11y: Toddy.Iced.A11y.t() | nil, children: [Toddy.Iced.ui_node() | struct()], height: Toddy.Iced.Length.t() | nil, id: String.t(), max_width: number() | nil, padding: Toddy.Iced.Padding.t() | nil, spacing: number() | nil, width: Toddy.Iced.Length.t() | nil }
Functions
@spec a11y(keyed_column :: t(), a11y :: Toddy.Iced.A11y.t()) :: t()
Sets accessibility annotations.
@spec build(keyed_column :: t()) :: Toddy.Iced.ui_node()
Converts this keyed column struct to a ui_node() map via the Toddy.Iced.Widget protocol.
@spec extend(keyed_column :: t(), children :: [Toddy.Iced.ui_node() | struct()]) :: t()
Appends multiple children to the keyed column.
@spec height(keyed_column :: t(), height :: Toddy.Iced.Length.t()) :: t()
Sets the column height.
Sets the maximum width in pixels.
Creates a new keyed column struct with optional keyword opts.
@spec padding(keyed_column :: t(), padding :: Toddy.Iced.Padding.t()) :: t()
Sets the padding inside the column.
@spec push(keyed_column :: t(), child :: Toddy.Iced.ui_node() | struct()) :: t()
Appends a child to the keyed column.
Sets the spacing between children in pixels.
@spec width(keyed_column :: t(), width :: Toddy.Iced.Length.t()) :: t()
Sets the column width.
Applies keyword options to an existing keyed column struct.