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
-
ColorBackground(color.Color) -
GradientBackground(gradient.Gradient)
Option type for container properties.
pub type Opt {
Padding(padding.Padding)
Width(length.Length)
Height(length.Length)
MaxWidth(Float)
MaxHeight(Float)
Center(Bool)
Clip(Bool)
AlignX(alignment.Alignment)
AlignY(alignment.Alignment)
BgColor(color.Color)
BgGradient(gradient.Gradient)
TextColor(color.Color)
Border(border.Border)
Shadow(shadow.Shadow)
Style(String)
A11y(a11y.A11y)
}
Constructors
-
Padding(padding.Padding) -
Width(length.Length) -
Height(length.Length) -
MaxWidth(Float) -
MaxHeight(Float) -
Center(Bool) -
Clip(Bool) -
AlignX(alignment.Alignment) -
AlignY(alignment.Alignment) -
BgColor(color.Color) -
BgGradient(gradient.Gradient) -
TextColor(color.Color) -
Border(border.Border) -
Shadow(shadow.Shadow) -
Style(String) -
A11y(a11y.A11y)
Values
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 gradient_background(
c: Container,
g: gradient.Gradient,
) -> Container
Set a gradient background.
pub fn height_animated(
c: Container,
animation: node.PropValue,
) -> Container
Set height to an animation descriptor (Transition, Spring, or Sequence).
The descriptor must be pre-encoded via its module’s encode function.
pub fn max_height_animated(
c: Container,
animation: node.PropValue,
) -> Container
Set max_height to an animation descriptor (Transition, Spring, or Sequence).
The descriptor must be pre-encoded via its module’s encode function.
pub fn max_width_animated(
c: Container,
animation: node.PropValue,
) -> Container
Set max_width to an animation descriptor (Transition, Spring, or Sequence).
The descriptor must be pre-encoded via its module’s encode function.
pub fn padding_animated(
c: Container,
animation: node.PropValue,
) -> Container
Set padding to an animation descriptor (Transition, Spring, or Sequence).
The descriptor must be pre-encoded via its module’s encode function.
pub fn width_animated(
c: Container,
animation: node.PropValue,
) -> Container
Set width to an animation descriptor (Transition, Spring, or Sequence).
The descriptor must be pre-encoded via its module’s encode function.