plushie/widget/container

Container widget builder (generic layout and styling).

Types

Background can be a solid color or a gradient.

pub type Background {
  ColorBackground(color.Color)
  GradientBackground(gradient.Gradient)
}

Constructors

pub opaque type Container

Values

pub fn a11y(c: Container, a: a11y.A11y) -> Container

Set accessibility properties for this widget.

pub fn align_x(c: Container, a: alignment.Alignment) -> Container

Set the horizontal alignment.

pub fn align_y(c: Container, a: alignment.Alignment) -> Container

Set the vertical alignment.

pub fn background(c: Container, col: color.Color) -> Container

Set a solid color background.

pub fn border(c: Container, b: border.Border) -> Container

Set the border.

pub fn build(c: Container) -> node.Node

Build the container into a renderable Node.

pub fn center(c: Container, enabled: Bool) -> Container

Set whether content is centered.

pub fn clip(c: Container, enabled: Bool) -> Container

Set whether overflowing content is clipped.

pub fn color(c: Container, col: color.Color) -> Container

Set the color.

pub fn extend(
  c: Container,
  children: List(node.Node),
) -> Container

Add multiple child nodes.

pub fn gradient_background(
  c: Container,
  g: gradient.Gradient,
) -> Container

Set a gradient background.

pub fn height(c: Container, h: length.Length) -> Container

Set the height.

pub fn max_height(c: Container, m: Float) -> Container

Set the maximum height in pixels.

pub fn max_width(c: Container, m: Float) -> Container

Set the maximum width.

pub fn new(id: String) -> Container

Create a new container builder.

pub fn padding(c: Container, p: padding.Padding) -> Container

Set the padding.

pub fn push(c: Container, child: node.Node) -> Container

Add a child node.

pub fn shadow(c: Container, s: shadow.Shadow) -> Container

Set the shadow.

pub fn style(c: Container, s: String) -> Container

Set the style.

pub fn width(c: Container, w: length.Length) -> Container

Set the width.

Search Document