Strict parity layer for iced widgets.
Every function maps 1:1 to an iced widget and returns a plain node map:
%{id: id, type: type_string, props: %{...}, children: [...]}No macro sugar, no auto-IDs -- just data. Props are accepted as atom-keyed maps for ergonomics and normalised to string keys in the output.
Per-widget modules
Each widget also lives in its own module under Toddy.Iced.Widget.*,
matching iced's iced::widget::* structure. Those modules provide typed
structs with builder functions for compile-time safety:
alias Toddy.Iced.Widget.Button
Button.new("btn", "Click me")
|> Button.style(:primary)
|> Button.build()This module provides untyped convenience functions that produce raw
ui_node() maps from props maps (matching iced's iced::widget::button()
pattern):
Toddy.Iced.button("btn", %{label: "Click me"})
Toddy.Iced.column("col", %{spacing: 10}, children)Types
Several prop values have shared formats across widgets. See the type helper modules for constructors and encoding:
Toddy.Iced.Length--:fill,:shrink,{:fill_portion, n}, or a numberToddy.Iced.Padding-- uniform number,{v, h}tuple, or per-side mapToddy.Iced.Color-- hex string"#rrggbb"/"#rrggbbaa", or%{r, g, b, a}map (0.0-1.0 floats)Toddy.Iced.Font--:default,:monospace, or%{family, weight, style, stretch}mapToddy.Iced.Alignment--:left/:center/:right/:top/:bottom(with:start/:endaliases)Toddy.Iced.Border--%{color, width, radius}mapToddy.Iced.Shadow--%{color, offset, blur_radius}mapToddy.Iced.Theme-- built-in theme atom or custom palette mapToddy.Iced.Gradient--%{type: "linear", angle, stops}map
Named styles
Many widgets accept a style prop (atom preset or StyleMap). The
available preset names vary by widget and map to iced's built-in style
functions. See each widget's documentation for the list of accepted values.
Summary
Types
Props map accepted by widget builders (atom keys, normalised to strings internally).
A UI tree node map. Every widget builder returns this shape.
Functions
Button -- clickable widget that emits %Widget{type: :click, id: id} events.
Canvas for drawing shapes.
Checkbox -- toggleable boolean input.
Column layout -- arranges children vertically.
Combo box -- searchable dropdown with free-form text input.
Container layout -- wraps a single child with padding, sizing, and styling.
Floating overlay -- positions child with optional translation and scaling.
Grid layout -- arranges children in a fixed-column grid.
Image display -- renders a raster image from a file path.
Keyed column -- like column/3 but uses child IDs as keys for efficient
list diffing.
Markdown display -- renders parsed markdown content.
Mouse area -- captures mouse events on child content.
Overlay container -- positions second child as a floating overlay relative to the first child (anchor).
Pane grid -- resizable tiled panes.
Pick list -- dropdown selection.
Pin layout -- positions child at absolute coordinates.
Progress bar -- displays progress within a range.
QR code display -- renders a QR code from a data string.
Radio button -- one-of-many selection.
Responsive layout -- adapts to available size by reporting resize events.
Rich text display with individually styled spans.
Row layout -- arranges children horizontally.
Horizontal or vertical rule (divider line).
Scrollable container -- wraps child content in a scrollable viewport.
Sensor -- detects visibility and size changes on child content.
Slider -- horizontal range input.
Empty space -- invisible spacer widget.
Stack layout -- layers children on top of each other.
SVG display -- renders a vector image from a file path.
Data table -- composite widget built from columns, rows, and scrollable containers.
Text display -- renders static text.
Text editor -- multi-line editable text area.
Text input field -- single-line editable text.
Per-subtree theme override -- applies a different theme to child widgets.
Toggler -- on/off switch.
Tooltip -- shows a popup tip over child content on hover.
Vertical slider -- vertical range input.
Types
Functions
Button -- clickable widget that emits %Widget{type: :click, id: id} events.
See Toddy.Iced.Widget.Button for full props documentation.
Canvas for drawing shapes.
See Toddy.Iced.Widget.Canvas for full props documentation.
Checkbox -- toggleable boolean input.
See Toddy.Iced.Widget.Checkbox for full props documentation.
Column layout -- arranges children vertically.
See Toddy.Iced.Widget.Column for full props documentation.
Combo box -- searchable dropdown with free-form text input.
See Toddy.Iced.Widget.ComboBox for full props documentation.
Container layout -- wraps a single child with padding, sizing, and styling.
See Toddy.Iced.Widget.Container for full props documentation.
Floating overlay -- positions child with optional translation and scaling.
See Toddy.Iced.Widget.Float for full props documentation.
Grid layout -- arranges children in a fixed-column grid.
See Toddy.Iced.Widget.Grid for full props documentation.
Image display -- renders a raster image from a file path.
See Toddy.Iced.Widget.Image for full props documentation.
Keyed column -- like column/3 but uses child IDs as keys for efficient
list diffing.
See Toddy.Iced.Widget.KeyedColumn for full props documentation.
Markdown display -- renders parsed markdown content.
See Toddy.Iced.Widget.Markdown for full props documentation.
Mouse area -- captures mouse events on child content.
See Toddy.Iced.Widget.MouseArea for full props documentation.
Overlay container -- positions second child as a floating overlay relative to the first child (anchor).
See Toddy.Iced.Widget.Overlay for full props documentation.
Pane grid -- resizable tiled panes.
See Toddy.Iced.Widget.PaneGrid for full props documentation.
Pick list -- dropdown selection.
See Toddy.Iced.Widget.PickList for full props documentation.
Pin layout -- positions child at absolute coordinates.
See Toddy.Iced.Widget.Pin for full props documentation.
Progress bar -- displays progress within a range.
See Toddy.Iced.Widget.ProgressBar for full props documentation.
QR code display -- renders a QR code from a data string.
See Toddy.Iced.Widget.QrCode for full props documentation.
Radio button -- one-of-many selection.
See Toddy.Iced.Widget.Radio for full props documentation.
Responsive layout -- adapts to available size by reporting resize events.
See Toddy.Iced.Widget.Responsive for full props documentation.
Rich text display with individually styled spans.
See Toddy.Iced.Widget.RichText for full props documentation.
Row layout -- arranges children horizontally.
See Toddy.Iced.Widget.Row for full props documentation.
Horizontal or vertical rule (divider line).
See Toddy.Iced.Widget.Rule for full props documentation.
Scrollable container -- wraps child content in a scrollable viewport.
See Toddy.Iced.Widget.Scrollable for full props documentation.
Sensor -- detects visibility and size changes on child content.
See Toddy.Iced.Widget.Sensor for full props documentation.
Slider -- horizontal range input.
See Toddy.Iced.Widget.Slider for full props documentation.
Empty space -- invisible spacer widget.
See Toddy.Iced.Widget.Space for full props documentation.
Stack layout -- layers children on top of each other.
See Toddy.Iced.Widget.Stack for full props documentation.
SVG display -- renders a vector image from a file path.
See Toddy.Iced.Widget.Svg for full props documentation.
Data table -- composite widget built from columns, rows, and scrollable containers.
See Toddy.Iced.Widget.Table for full props documentation.
Text display -- renders static text.
See Toddy.Iced.Widget.Text for full props documentation.
Text editor -- multi-line editable text area.
See Toddy.Iced.Widget.TextEditor for full props documentation.
Text input field -- single-line editable text.
See Toddy.Iced.Widget.TextInput for full props documentation.
Per-subtree theme override -- applies a different theme to child widgets.
See Toddy.Iced.Widget.Themer for full props documentation.
Toggler -- on/off switch.
See Toddy.Iced.Widget.Toggler for full props documentation.
@spec tooltip( id :: String.t(), tip :: String.t(), props :: props(), children :: [ui_node()] ) :: ui_node()
Tooltip -- shows a popup tip over child content on hover.
See Toddy.Iced.Widget.Tooltip for full props documentation.
Vertical slider -- vertical range input.
See Toddy.Iced.Widget.VerticalSlider for full props documentation.