Plushie.Widget.Stack (Plushie v0.6.0)

Copy Markdown View Source

Stack layout -- layers children on top of each other.

Props

  • width (length) -- stack width. Default: shrink. See Plushie.Type.Length.
  • height (length) -- stack height. Default: shrink.
  • clip (boolean) -- clip children that overflow. Default: false.
  • a11y (map) -- accessibility overrides. See Plushie.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

option()

@type option() ::
  {:width, Plushie.Type.Length.t()}
  | {:height, Plushie.Type.Length.t()}
  | {:clip, boolean()}
  | {:a11y, Plushie.Type.A11y.t() | map() | keyword()}

t()

@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

a11y(stack, a11y)

@spec a11y(stack :: t(), a11y :: Plushie.Type.A11y.t() | map() | keyword()) :: t()

Sets accessibility annotations.

build(stack)

@spec build(stack :: t()) :: Plushie.Widget.ui_node()

Converts this stack struct to a ui_node() map via the Plushie.Widget protocol.

clip(stack, clip)

@spec clip(stack :: t(), clip :: boolean()) :: t()

Sets whether children that overflow are clipped.

extend(stack, children)

@spec extend(stack :: t(), children :: [Plushie.Widget.child()]) :: t()

Appends multiple children to the stack.

height(stack, height)

@spec height(stack :: t(), height :: Plushie.Type.Length.t()) :: t()

Sets the stack height.

new(id, opts \\ [])

@spec new(id :: String.t(), opts :: [option()]) :: t()

Creates a new stack struct with optional keyword opts.

push(stack, child)

@spec push(stack :: t(), child :: Plushie.Widget.child()) :: t()

Appends a child to the stack.

width(stack, width)

@spec width(stack :: t(), width :: Plushie.Type.Length.t()) :: t()

Sets the stack width.

with_options(stack, opts)

@spec with_options(stack :: t(), opts :: [option()]) :: t()

Applies keyword options to an existing stack struct.