Container

class Container(val width: Size? = null, val height: Size? = null, val fullWidth: Boolean = false, val foregroundColor: Color? = null, val backgroundColor: Color? = null, val borderColor: Color? = null, val borderWidth: Sizes? = null, val borderStyle: Container.BorderStyle? = null, val margin: Sizes? = null, val padding: Sizes? = null, val cornerRadius: Sizes? = null, val alignment: Container.Alignment? = null, val textAlignment: Container.Alignment? = null, val float: Container.FloatAlignment? = null, val children: List<Node>) : NestableNode

A general-purpose container that groups content.

Parameters

width

width of the container

height

height of the container

fullWidth

whether the container should take up the full width of the parent. Overridden by width

foregroundColor

text color

backgroundColor

background color

borderColor

border color

borderWidth

border width

borderStyle

border style

margin

whitespace outside the content

padding

whitespace around the content

cornerRadius

border radius of the container

alignment

alignment of the content

textAlignment

alignment of the text

float

floating position of the container within the subsequent content

Constructors

Link copied to clipboard
constructor(width: Size? = null, height: Size? = null, fullWidth: Boolean = false, foregroundColor: Color? = null, backgroundColor: Color? = null, borderColor: Color? = null, borderWidth: Sizes? = null, borderStyle: Container.BorderStyle? = null, margin: Sizes? = null, padding: Sizes? = null, cornerRadius: Sizes? = null, alignment: Container.Alignment? = null, textAlignment: Container.Alignment? = null, float: Container.FloatAlignment? = null, children: List<Node>)

Types

Link copied to clipboard

Possible alignment types of a Container.

Link copied to clipboard
Link copied to clipboard

Properties

Link copied to clipboard
Link copied to clipboard
val backgroundColor: Color? = null
Link copied to clipboard
val borderColor: Color? = null
Link copied to clipboard
Link copied to clipboard
val borderWidth: Sizes? = null
Link copied to clipboard
open override val children: List<Node>
Link copied to clipboard
val cornerRadius: Sizes? = null
Link copied to clipboard
Link copied to clipboard
val foregroundColor: Color? = null
Link copied to clipboard
val fullWidth: Boolean = false
Link copied to clipboard
val height: Size? = null
Link copied to clipboard
val margin: Sizes? = null
Link copied to clipboard
val padding: Sizes? = null
Link copied to clipboard
Link copied to clipboard
val width: Size? = null

Functions

Link copied to clipboard
open override fun <T> accept(visitor: NodeVisitor<T>): T

Accepts a visitor.

Link copied to clipboard

Returns a sequence of all nodes in the tree, where this is the root node. The sequence is generated by traversing the tree in depth-first order. The root node is excluded from the sequence.

Link copied to clipboard