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
| Name | Type | Default | Description |
|---|---|---|---|
spacing | number() | nil | Vertical space between children in pixels. Default: 0. |
padding | number() | {number(), number()} | %Plushie.Type.Padding{} | nil | Padding inside the column. |
width | :fill | :shrink | {:fill_portion, pos_integer()} | number() | nil | Column width. Default: shrink. |
height | :fill | :shrink | {:fill_portion, pos_integer()} | number() | nil | Column height. Default: shrink. |
align_x | :left | :center | :right | :top | :bottom | nil | Horizontal alignment of children: :left, :center, :right. |
max_width | number() | nil | Maximum width in pixels. |
event_rate | integer() | nil | Max events per second for coalescable events. |
a11y | %Plushie.Type.A11y{} | map() | keyword() | nil | Accessibility annotations. |
Summary
Functions
Accessibility annotations.
Horizontal alignment of children: :left, :center, :right.
Converts this widget struct to a ui_node() map.
Max events per second for coalescable events.
Appends multiple children to the widget.
Column height. Default: shrink.
Creates a :keyed_column widget.
Maximum width in pixels.
Creates a new widget struct with the given ID and keyword options.
Padding inside the column.
Appends a child to the widget.
Vertical space between children in pixels. Default: 0.
Column width. Default: shrink.
Applies keyword options to an existing widget struct.
Types
@type option() :: (((((({:spacing, number()} | {:padding, number() | {number(), number()} | %Plushie.Type.Padding{ bottom: term(), left: term(), right: term(), top: term() }}) | {:width, :fill | :shrink | {:fill_portion, pos_integer()} | number()}) | {:height, :fill | :shrink | {:fill_portion, pos_integer()} | number()}) | {:align_x, :left | :center | :right | :top | :bottom}) | {:max_width, number()}) | {:event_rate, integer()}) | {:a11y, %Plushie.Type.A11y{ active_descendant: term(), busy: term(), described_by: term(), description: term(), disabled: term(), error_message: term(), expanded: term(), has_popup: term(), hidden: term(), invalid: term(), label: term(), label_from: term(), labelled_by: term(), level: term(), live: term(), mnemonic: term(), modal: term(), orientation: term(), position_in_set: term(), radio_group: term(), read_only: term(), required: term(), role: term(), selected: term(), size_of_set: term(), toggled: term(), value: term() } | map() | keyword()}
@type t() :: %Plushie.Widget.KeyedColumn{ a11y: (%Plushie.Type.A11y{ active_descendant: term(), busy: term(), described_by: term(), description: term(), disabled: term(), error_message: term(), expanded: term(), has_popup: term(), hidden: term(), invalid: term(), label: term(), label_from: term(), labelled_by: term(), level: term(), live: term(), mnemonic: term(), modal: term(), orientation: term(), position_in_set: term(), radio_group: term(), read_only: term(), required: term(), role: term(), selected: term(), size_of_set: term(), toggled: term(), value: term() } | map() | keyword()) | Plushie.Animation.Transition.t() | Plushie.Animation.Spring.t() | Plushie.Animation.Sequence.t() | nil, align_x: (:left | :center | :right | :top | :bottom) | Plushie.Animation.Transition.t() | Plushie.Animation.Spring.t() | Plushie.Animation.Sequence.t() | nil, children: [Plushie.Widget.ui_node()], event_rate: integer() | Plushie.Animation.Transition.t() | Plushie.Animation.Spring.t() | Plushie.Animation.Sequence.t() | nil, height: (:fill | :shrink | {:fill_portion, pos_integer()} | number()) | Plushie.Animation.Transition.t() | Plushie.Animation.Spring.t() | Plushie.Animation.Sequence.t() | nil, id: String.t(), max_width: number() | Plushie.Animation.Transition.t() | Plushie.Animation.Spring.t() | Plushie.Animation.Sequence.t() | nil, padding: (number() | {number(), number()} | %Plushie.Type.Padding{ bottom: term(), left: term(), right: term(), top: term() }) | Plushie.Animation.Transition.t() | Plushie.Animation.Spring.t() | Plushie.Animation.Sequence.t() | nil, spacing: number() | Plushie.Animation.Transition.t() | Plushie.Animation.Spring.t() | Plushie.Animation.Sequence.t() | nil, width: (:fill | :shrink | {:fill_portion, pos_integer()} | number()) | Plushie.Animation.Transition.t() | Plushie.Animation.Spring.t() | Plushie.Animation.Sequence.t() | nil }
Functions
@spec a11y( widget :: t(), value :: (%Plushie.Type.A11y{ active_descendant: term(), busy: term(), described_by: term(), description: term(), disabled: term(), error_message: term(), expanded: term(), has_popup: term(), hidden: term(), invalid: term(), label: term(), label_from: term(), labelled_by: term(), level: term(), live: term(), mnemonic: term(), modal: term(), orientation: term(), position_in_set: term(), radio_group: term(), read_only: term(), required: term(), role: term(), selected: term(), size_of_set: term(), toggled: term(), value: term() } | map() | keyword()) | nil ) :: t()
Accessibility annotations.
Accepts %Plushie.Type.A11y{} | map() | keyword().
Horizontal alignment of children: :left, :center, :right.
Accepts :left | :center | :right | :top | :bottom.
@spec build(widget :: t()) :: Plushie.Widget.ui_node()
Converts this widget struct to a ui_node() map.
Max events per second for coalescable events.
Accepts integer().
@spec extend(widget :: t(), children :: [Plushie.Widget.child()]) :: t()
Appends multiple children to the widget.
@spec height( widget :: t(), value :: (:fill | :shrink | {:fill_portion, pos_integer()} | number()) | nil ) :: t()
Column height. Default: shrink.
Accepts :fill | :shrink | {:fill_portion, pos_integer()} | number().
Creates a :keyed_column widget.
Shorthand for new/2. Import this macro to use the widget name
directly in view functions:
import Plushie.Widget.KeyedColumn, only: [keyed_column: 2]
keyed_column("my-id", prop: value)
Maximum width in pixels.
Accepts number().
Creates a new widget struct with the given ID and keyword options.
@spec padding( widget :: t(), value :: (number() | {number(), number()} | %Plushie.Type.Padding{ bottom: term(), left: term(), right: term(), top: term() }) | nil ) :: t()
Padding inside the column.
Accepts number() | {number(), number()} | %Plushie.Type.Padding{}.
@spec push(widget :: t(), child :: Plushie.Widget.child()) :: t()
Appends a child to the widget.
Vertical space between children in pixels. Default: 0.
Accepts number().
@spec width( widget :: t(), value :: (:fill | :shrink | {:fill_portion, pos_integer()} | number()) | nil ) :: t()
Column width. Default: shrink.
Accepts :fill | :shrink | {:fill_portion, pos_integer()} | number().
Applies keyword options to an existing widget struct.