Stack layout -- layers children on top of each other.
Props
width(length) -- stack width. Default: shrink. SeePlushie.Type.Length.height(length) -- stack height. Default: shrink.clip(boolean) -- clip children that overflow. Default: false.a11y(map) -- accessibility overrides. SeePlushie.Type.A11y.
Summary
Functions
Sets accessibility annotations.
Converts this stack struct to a ui_node() map via the Plushie.Widget protocol.
Sets whether children that overflow are clipped.
Appends multiple children to the stack.
Sets the stack height.
Creates a new stack struct with optional keyword opts.
Appends a child to the stack.
Sets the stack width.
Applies keyword options to an existing stack struct.
Types
@type option() :: {:width, Plushie.Type.Length.t()} | {:height, Plushie.Type.Length.t()} | {:clip, boolean()} | {:a11y, Plushie.Type.A11y.t() | map() | keyword()}
@type t() :: %Plushie.Widget.Stack{ a11y: Plushie.Type.A11y.t() | nil, children: [Plushie.Widget.child()], clip: boolean() | nil, height: Plushie.Type.Length.t() | nil, id: String.t(), width: Plushie.Type.Length.t() | nil }
Functions
@spec a11y(stack :: t(), a11y :: Plushie.Type.A11y.t() | map() | keyword()) :: t()
Sets accessibility annotations.
@spec build(stack :: t()) :: Plushie.Widget.ui_node()
Converts this stack struct to a ui_node() map via the Plushie.Widget protocol.
Sets whether children that overflow are clipped.
@spec extend(stack :: t(), children :: [Plushie.Widget.child()]) :: t()
Appends multiple children to the stack.
@spec height(stack :: t(), height :: Plushie.Type.Length.t()) :: t()
Sets the stack height.
Creates a new stack struct with optional keyword opts.
@spec push(stack :: t(), child :: Plushie.Widget.child()) :: t()
Appends a child to the stack.
@spec width(stack :: t(), width :: Plushie.Type.Length.t()) :: t()
Sets the stack width.
Applies keyword options to an existing stack struct.