Skip to content

Minimal box

The MinimalBox element loosens the size constraints provided by its parent. It makes sure that its child is rendered only with necessary space, no bigger.



 












.Border(4)
.BorderColor(Colors.Blue.Medium)
.MinimalBox()
.Background(Colors.Grey.Lighten2)
.Padding(15)
.Text("Test of the \n box element")
.FontSize(20);
.Border(4)
.BorderColor(Colors.Blue.Medium)
.MinimalBox()
.Background(Colors.Grey.Lighten2)
.Padding(15)
.Text("Test of the \n box element")
.FontSize(20);

Without using the MinimalBox element (notice that the text element takes entire space provided by its parent):

example

With using the MinimalBox element (notice that the text element takes only necessary space):

example

Released under the MIT License.