Floating overlay -- positions child with optional translation and scaling.
Props
translate_x(number) -- horizontal translation in pixels. Default: 0.translate_y(number) -- vertical translation in pixels. Default: 0.scale(number) -- scale factor for the child content.width(length) -- float width. SeePlushie.Type.Length.height(length) -- float height. SeePlushie.Type.Length.a11y(map) -- accessibility overrides. SeePlushie.Type.A11y.
Summary
Functions
Sets accessibility annotations.
Converts this float struct to a ui_node() map via the Plushie.Widget protocol.
Appends multiple children to the float.
Sets the float height.
Creates a new float struct with optional keyword opts.
Appends a child to the float.
Sets the scale factor.
Sets the horizontal translation in pixels.
Sets the vertical translation in pixels.
Sets the float width.
Applies keyword options to an existing float struct.
Types
@type option() :: {:translate_x, number()} | {:translate_y, number()} | {:scale, number()} | {:width, Plushie.Type.Length.t()} | {:height, Plushie.Type.Length.t()} | {:a11y, Plushie.Type.A11y.t() | map() | keyword()}
@type t() :: %Plushie.Widget.Floating{ a11y: Plushie.Type.A11y.t() | nil, children: [Plushie.Widget.child()], height: Plushie.Type.Length.t() | nil, id: String.t(), scale: number() | nil, translate_x: number() | nil, translate_y: number() | nil, width: Plushie.Type.Length.t() | nil }
Functions
@spec a11y(floating :: t(), a11y :: Plushie.Type.A11y.t() | map() | keyword()) :: t()
Sets accessibility annotations.
@spec build(floating :: t()) :: Plushie.Widget.ui_node()
Converts this float struct to a ui_node() map via the Plushie.Widget protocol.
@spec extend(floating :: t(), children :: [Plushie.Widget.child()]) :: t()
Appends multiple children to the float.
@spec height(floating :: t(), height :: Plushie.Type.Length.t()) :: t()
Sets the float height.
Creates a new float struct with optional keyword opts.
@spec push(floating :: t(), child :: Plushie.Widget.child()) :: t()
Appends a child to the float.
Sets the scale factor.
Sets the horizontal translation in pixels.
Sets the vertical translation in pixels.
@spec width(floating :: t(), width :: Plushie.Type.Length.t()) :: t()
Sets the float width.
Applies keyword options to an existing float struct.