Top-level window container node.
Holds window-level configuration (title, size, position, decorations,
etc.) and wraps the child widget tree for that window. The runtime
detects window nodes by their "window" type string and synchronizes
open/close/update operations with the Rust binary via the bridge.
Props
| Name | Type | Default | Description |
|---|---|---|---|
title | String.t() | atom() | nil | Window title bar text. |
size | {number(), number()} | nil | Initial window size as {width, height} tuple. |
width | :fill | :shrink | {:fill_portion, pos_integer()} | number() | nil | Content width layout. Default: fill. |
height | :fill | :shrink | {:fill_portion, pos_integer()} | number() | nil | Content height layout. Default: fill. |
position | {number(), number()} | nil | Initial window position as {x, y} tuple. |
min_size | {number(), number()} | nil | Minimum window dimensions as {width, height}. |
max_size | {number(), number()} | nil | Maximum window dimensions as {width, height}. |
maximized | boolean() | nil | Start maximized. |
fullscreen | boolean() | nil | Start in fullscreen mode. |
visible | boolean() | nil | Whether the window is visible. |
resizable | boolean() | nil | Whether the window can be resized. |
closeable | boolean() | nil | Whether the window close button is shown. |
minimizable | boolean() | nil | Whether the window can be minimized. |
decorations | boolean() | nil | Show window decorations (title bar, borders). |
transparent | boolean() | nil | Transparent window background. |
blur | boolean() | nil | Blur the window background. |
level | :normal | :always_on_top | :always_on_bottom | nil | Stacking level: :normal, :always_on_top, :always_on_bottom. |
exit_on_close_request | boolean() | nil | Whether closing the window exits the app. |
scale_factor | number() | nil | Window scale factor override. |
theme | atom() | map() | nil | Per-window theme: built-in atom, :system, or custom palette. |
event_rate | integer() | nil | Max events per second for coalescable events. |
a11y | %Plushie.Type.A11y{} | map() | keyword() | %{role: :window} | Accessibility annotations. |
Summary
Functions
Accessibility annotations.
Blur the window background.
Converts this widget struct to a ui_node() map. Validates at most one child.
Whether the window close button is shown.
Show window decorations (title bar, borders).
Max events per second for coalescable events.
Whether closing the window exits the app.
Appends multiple children to the widget.
Start in fullscreen mode.
Content height layout. Default: fill.
Stacking level: :normal, :always_on_top, :always_on_bottom.
Maximum window dimensions as {width, height}.
Start maximized.
Minimum window dimensions as {width, height}.
Whether the window can be minimized.
Creates a new widget struct with the given ID and keyword options.
Initial window position as {x, y} tuple.
Appends a child to the widget.
Whether the window can be resized.
Window scale factor override.
Initial window size as {width, height} tuple.
Per-window theme: built-in atom, :system, or custom palette.
Window title bar text.
Transparent window background.
Whether the window is visible.
Content width layout. Default: fill.
Creates a :window widget.
Applies keyword options to an existing widget struct.
Types
@type option() :: (((((((((((((((((((({:title, String.t() | atom()} | {:size, {number(), number()}}) | {:width, :fill | :shrink | {:fill_portion, pos_integer()} | number()}) | {:height, :fill | :shrink | {:fill_portion, pos_integer()} | number()}) | {:position, {number(), number()}}) | {:min_size, {number(), number()}}) | {:max_size, {number(), number()}}) | {:maximized, boolean()}) | {:fullscreen, boolean()}) | {:visible, boolean()}) | {:resizable, boolean()}) | {:closeable, boolean()}) | {:minimizable, boolean()}) | {:decorations, boolean()}) | {:transparent, boolean()}) | {:blur, boolean()}) | {:level, :normal | :always_on_top | :always_on_bottom}) | {:exit_on_close_request, boolean()}) | {:scale_factor, number()}) | {:theme, atom() | map()}) | {: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.Window{ 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, blur: boolean() | Plushie.Animation.Transition.t() | Plushie.Animation.Spring.t() | Plushie.Animation.Sequence.t() | nil, children: [Plushie.Widget.ui_node()], closeable: boolean() | Plushie.Animation.Transition.t() | Plushie.Animation.Spring.t() | Plushie.Animation.Sequence.t() | nil, decorations: boolean() | Plushie.Animation.Transition.t() | Plushie.Animation.Spring.t() | Plushie.Animation.Sequence.t() | nil, event_rate: integer() | Plushie.Animation.Transition.t() | Plushie.Animation.Spring.t() | Plushie.Animation.Sequence.t() | nil, exit_on_close_request: boolean() | Plushie.Animation.Transition.t() | Plushie.Animation.Spring.t() | Plushie.Animation.Sequence.t() | nil, fullscreen: boolean() | 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(), level: (:normal | :always_on_top | :always_on_bottom) | Plushie.Animation.Transition.t() | Plushie.Animation.Spring.t() | Plushie.Animation.Sequence.t() | nil, max_size: {number(), number()} | Plushie.Animation.Transition.t() | Plushie.Animation.Spring.t() | Plushie.Animation.Sequence.t() | nil, maximized: boolean() | Plushie.Animation.Transition.t() | Plushie.Animation.Spring.t() | Plushie.Animation.Sequence.t() | nil, min_size: {number(), number()} | Plushie.Animation.Transition.t() | Plushie.Animation.Spring.t() | Plushie.Animation.Sequence.t() | nil, minimizable: boolean() | Plushie.Animation.Transition.t() | Plushie.Animation.Spring.t() | Plushie.Animation.Sequence.t() | nil, position: {number(), number()} | Plushie.Animation.Transition.t() | Plushie.Animation.Spring.t() | Plushie.Animation.Sequence.t() | nil, resizable: boolean() | Plushie.Animation.Transition.t() | Plushie.Animation.Spring.t() | Plushie.Animation.Sequence.t() | nil, scale_factor: number() | Plushie.Animation.Transition.t() | Plushie.Animation.Spring.t() | Plushie.Animation.Sequence.t() | nil, size: {number(), number()} | Plushie.Animation.Transition.t() | Plushie.Animation.Spring.t() | Plushie.Animation.Sequence.t() | nil, theme: (atom() | map()) | Plushie.Animation.Transition.t() | Plushie.Animation.Spring.t() | Plushie.Animation.Sequence.t() | nil, title: (String.t() | atom()) | Plushie.Animation.Transition.t() | Plushie.Animation.Spring.t() | Plushie.Animation.Sequence.t() | nil, transparent: boolean() | Plushie.Animation.Transition.t() | Plushie.Animation.Spring.t() | Plushie.Animation.Sequence.t() | nil, visible: boolean() | 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().
Blur the window background.
Accepts boolean().
@spec build(widget :: t()) :: Plushie.Widget.ui_node()
Converts this widget struct to a ui_node() map. Validates at most one child.
Whether the window close button is shown.
Accepts boolean().
Show window decorations (title bar, borders).
Accepts boolean().
Max events per second for coalescable events.
Accepts integer().
Whether closing the window exits the app.
Accepts boolean().
@spec extend(widget :: t(), children :: [Plushie.Widget.child()]) :: t()
Appends multiple children to the widget.
Start in fullscreen mode.
Accepts boolean().
@spec height( widget :: t(), value :: (:fill | :shrink | {:fill_portion, pos_integer()} | number()) | nil ) :: t()
Content height layout. Default: fill.
Accepts :fill | :shrink | {:fill_portion, pos_integer()} | number().
Stacking level: :normal, :always_on_top, :always_on_bottom.
Accepts :normal | :always_on_top | :always_on_bottom.
Maximum window dimensions as {width, height}.
Accepts {number(), number()}.
Start maximized.
Accepts boolean().
Minimum window dimensions as {width, height}.
Accepts {number(), number()}.
Whether the window can be minimized.
Accepts boolean().
Creates a new widget struct with the given ID and keyword options.
Initial window position as {x, y} tuple.
Accepts {number(), number()}.
@spec push(widget :: t(), child :: Plushie.Widget.child()) :: t()
Appends a child to the widget.
Whether the window can be resized.
Accepts boolean().
Window scale factor override.
Accepts number().
Initial window size as {width, height} tuple.
Accepts {number(), number()}.
Per-window theme: built-in atom, :system, or custom palette.
Accepts atom() | map().
Window title bar text.
Accepts String.t() | atom().
Transparent window background.
Accepts boolean().
Whether the window is visible.
Accepts boolean().
@spec width( widget :: t(), value :: (:fill | :shrink | {:fill_portion, pos_integer()} | number()) | nil ) :: t()
Content width layout. Default: fill.
Accepts :fill | :shrink | {:fill_portion, pos_integer()} | number().
Creates a :window widget.
Shorthand for new/2. Import this macro to use the widget name
directly in view functions:
import Plushie.Widget.Window, only: [window: 2]
window("my-id", prop: value)
Applies keyword options to an existing widget struct.