Toddy.Iced.Widget.Stack (Toddy v0.3.0)

Copy Markdown View Source

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

Props

  • width (length) -- stack width. Default: shrink. See Toddy.Iced.Length.
  • height (length) -- stack height. Default: shrink.
  • clip (boolean) -- clip children that overflow. Default: false.
  • a11y (map) -- accessibility overrides. See Toddy.Iced.A11y.

Summary

Functions

Sets accessibility annotations.

Converts this stack struct to a ui_node() map via the Toddy.Iced.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, Toddy.Iced.Length.t()}
  | {:height, Toddy.Iced.Length.t()}
  | {:clip, boolean()}
  | {:a11y, Toddy.Iced.A11y.t()}

t()

@type t() :: %Toddy.Iced.Widget.Stack{
  a11y: Toddy.Iced.A11y.t() | nil,
  children: [Toddy.Iced.ui_node() | struct()],
  clip: boolean() | nil,
  height: Toddy.Iced.Length.t() | nil,
  id: String.t(),
  width: Toddy.Iced.Length.t() | nil
}

Functions

a11y(stack, a11y)

@spec a11y(stack :: t(), a11y :: Toddy.Iced.A11y.t()) :: t()

Sets accessibility annotations.

build(stack)

@spec build(stack :: t()) :: Toddy.Iced.ui_node()

Converts this stack struct to a ui_node() map via the Toddy.Iced.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 :: [Toddy.Iced.ui_node() | struct()]) :: t()

Appends multiple children to the stack.

height(stack, height)

@spec height(stack :: t(), height :: Toddy.Iced.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 :: Toddy.Iced.ui_node() | struct()) :: t()

Appends a child to the stack.

width(stack, width)

@spec width(stack :: t(), width :: Toddy.Iced.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.