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

Copy Markdown View Source

Empty space -- invisible spacer widget.

Props

  • width (length) -- space width. Default: shrink. See Toddy.Iced.Length.
  • height (length) -- space height. Default: shrink.
  • a11y (map) -- accessibility overrides. See Toddy.Iced.A11y.

Summary

Functions

Sets accessibility annotations.

Converts this space struct to a ui_node() map via the Toddy.Iced.Widget protocol.

Sets the space height.

Creates a new space struct with optional keyword opts.

Sets the space width.

Applies keyword options to an existing space struct.

Types

option()

@type option() ::
  {:width, Toddy.Iced.Length.t()}
  | {:height, Toddy.Iced.Length.t()}
  | {:a11y, Toddy.Iced.A11y.t()}

t()

@type t() :: %Toddy.Iced.Widget.Space{
  a11y: Toddy.Iced.A11y.t() | nil,
  height: Toddy.Iced.Length.t() | nil,
  id: String.t(),
  width: Toddy.Iced.Length.t() | nil
}

Functions

a11y(space, a11y)

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

Sets accessibility annotations.

build(space)

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

Converts this space struct to a ui_node() map via the Toddy.Iced.Widget protocol.

height(space, height)

@spec height(space :: t(), height :: Toddy.Iced.Length.t()) :: t()

Sets the space height.

new(id, opts \\ [])

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

Creates a new space struct with optional keyword opts.

width(space, width)

@spec width(space :: t(), width :: Toddy.Iced.Length.t()) :: t()

Sets the space width.

with_options(space, opts)

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

Applies keyword options to an existing space struct.