Plushie.Widget.Space (Plushie v0.6.0)

Copy Markdown View Source

Empty space -- invisible spacer widget.

Props

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

Summary

Functions

Sets accessibility annotations.

Converts this space struct to a ui_node() map via the Plushie.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, Plushie.Type.Length.t()}
  | {:height, Plushie.Type.Length.t()}
  | {:a11y, Plushie.Type.A11y.t() | map() | keyword()}

t()

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

Functions

a11y(space, a11y)

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

Sets accessibility annotations.

build(space)

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

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

height(space, height)

@spec height(space :: t(), height :: Plushie.Type.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 :: Plushie.Type.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.