plushie/widget/pin

Pin widget builder (absolutely positioned element).

Types

Option type for pin properties.

pub type Opt {
  X(Float)
  Y(Float)
  Width(length.Length)
  Height(length.Length)
  A11y(a11y.A11y)
}

Constructors

pub opaque type Pin

Values

pub fn a11y(p: Pin, a: a11y.A11y) -> Pin

Set accessibility properties for this widget.

pub fn build(p: Pin) -> node.Node

Build the pin into a renderable Node.

pub fn extend(p: Pin, children: List(node.Node)) -> Pin

Add multiple child nodes.

pub fn height(p: Pin, h: length.Length) -> Pin

Set the height.

pub fn new(id: String) -> Pin

Create a new pin builder.

pub fn push(p: Pin, child: node.Node) -> Pin

Add a child node.

pub fn width(p: Pin, w: length.Length) -> Pin

Set the width.

pub fn with_opts(p: Pin, opts: List(Opt)) -> Pin

Apply a list of options to a pin builder.

pub fn x(p: Pin, val: Float) -> Pin

Set the x position.

pub fn x_animated(p: Pin, animation: node.PropValue) -> Pin

Set x to an animation descriptor (Transition, Spring, or Sequence). The descriptor must be pre-encoded via its module’s encode function.

pub fn y(p: Pin, val: Float) -> Pin

Set the y position.

pub fn y_animated(p: Pin, animation: node.PropValue) -> Pin

Set y to an animation descriptor (Transition, Spring, or Sequence). The descriptor must be pre-encoded via its module’s encode function.

Search Document