Canvas rectangle element with position, size, and optional styling.
Summary
Functions
Converts this widget struct to a ui_node() map.
Fill color or gradient.
Fill rule: "non_zero" or "even_odd".
Height in pixels.
Creates a new element without an explicit ID (auto-assigned by parent container).
Creates a new element with the given ID, positional args, and keyword options.
Opacity from 0.0 (transparent) to 1.0 (opaque).
Corner radius. Uniform number or per-corner map.
Stroke descriptor (color, width, cap, join).
Returns the element type string for the wire protocol.
Width in pixels.
Applies keyword options to an existing widget struct.
X position in pixels.
Y position in pixels.
Types
@type option() :: ((((((({:x, number()} | {:y, number()}) | {:w, number()}) | {:h, number()}) | {:fill, term()}) | {:stroke, %Plushie.Canvas.Stroke{ cap: term(), color: term(), dash: term(), join: term(), width: term() } | keyword() | map()}) | {:opacity, number()}) | {:fill_rule, String.t() | atom()}) | {:radius, term()}
@type t() :: %Plushie.Canvas.Rect{ fill: term() | Plushie.Animation.Transition.t() | Plushie.Animation.Spring.t() | Plushie.Animation.Sequence.t() | nil, fill_rule: (String.t() | atom()) | Plushie.Animation.Transition.t() | Plushie.Animation.Spring.t() | Plushie.Animation.Sequence.t() | nil, h: number() | Plushie.Animation.Transition.t() | Plushie.Animation.Spring.t() | Plushie.Animation.Sequence.t() | nil, id: String.t() | nil, opacity: number() | Plushie.Animation.Transition.t() | Plushie.Animation.Spring.t() | Plushie.Animation.Sequence.t() | nil, radius: term() | Plushie.Animation.Transition.t() | Plushie.Animation.Spring.t() | Plushie.Animation.Sequence.t() | nil, stroke: %Plushie.Canvas.Stroke{ cap: term(), color: term(), dash: term(), join: term(), width: term() } | Plushie.Animation.Transition.t() | Plushie.Animation.Spring.t() | Plushie.Animation.Sequence.t() | nil, w: number() | Plushie.Animation.Transition.t() | Plushie.Animation.Spring.t() | Plushie.Animation.Sequence.t() | nil, x: number() | Plushie.Animation.Transition.t() | Plushie.Animation.Spring.t() | Plushie.Animation.Sequence.t() | nil, y: number() | Plushie.Animation.Transition.t() | Plushie.Animation.Spring.t() | Plushie.Animation.Sequence.t() | nil }
Functions
@spec build(widget :: t()) :: Plushie.Widget.ui_node()
Converts this widget struct to a ui_node() map.
Fill color or gradient.
Accepts term().
Fill rule: "non_zero" or "even_odd".
Accepts String.t() | atom().
Height in pixels.
Accepts number().
Creates a new element without an explicit ID (auto-assigned by parent container).
Creates a new element with the given ID, positional args, and keyword options.
Opacity from 0.0 (transparent) to 1.0 (opaque).
Accepts number().
Corner radius. Uniform number or per-corner map.
Accepts term().
@spec stroke( widget :: t(), value :: (%Plushie.Canvas.Stroke{ cap: term(), color: term(), dash: term(), join: term(), width: term() } | keyword() | map()) | nil ) :: t()
Stroke descriptor (color, width, cap, join).
Accepts %Plushie.Canvas.Stroke{}.
@spec type_name() :: String.t()
Returns the element type string for the wire protocol.
Width in pixels.
Accepts number().
Applies keyword options to an existing widget struct.
X position in pixels.
Accepts number().
Y position in pixels.
Accepts number().