[box width=200 height=100 bg-color=#ffffff] {
Hello World
}
[box id="my_panel" .container width=300 height=200] {
Content here
}
[box] {
[box width=50%] {
Left side
}
[box width=50%] {
Right side
}
}
[box] {
This is some text
}
[box] {
[span color=#ff0000 value="Red text"]
and normal text
}
[box align=center width=200] {
Centered text
}
[box] {
This is multiline text
that spans several lines
}
[image src="path/to/image.png" width=100 height=100]
[image src="path/to/image.png" width=200 height=150 fit=cover]
[box direction=row] {
[box width=100 height=50 bg-color=#ff0000] { }
[box width=100 height=50 bg-color=#00ff00] { }
[box width=100 height=50 bg-color=#0000ff] { }
}
[box direction=column] {
[box width=100 height=50 bg-color=#ff0000] { }
[box width=100 height=50 bg-color=#00ff00] { }
[box width=100 height=50 bg-color=#0000ff] { }
}
[box width=100% height=100% justify-content=center align-items=center] {
[box width=200 height=100 bg-color=#cccccc] {
Centered content
}
}
[box width=200 direction=row wrap=true] {
[box width=100 height=100 bg-color=#ff0000] { 1 }
[box width=100 height=100 bg-color=#00ff00] { 2 }
[box width=100 height=100 bg-color=#0000ff] { 3 }
[box width=100 height=100 bg-color=#ffff00] { 4 }
[box width=100 height=100 bg-color=#ff00ff] { 5 }
}
[style] {
.my_class {
bg-color: #ffffff;
color: #000000;
padding: 10;
}
}
[box .my_class] {
Styled text
}
[style] {
[box] {
bg-color: #f0f0f0;
}
}
[style] {
$my_id {
width: 200;
height: 100;
}
}
[box id="my_id"] {
Specific box
}
[style] {
box > [box] {
margin: 5;
}
}
[box .button width=120 height=40 bg-color=#007bff] {
Click Me
}
[box direction=column padding=20] {
[box align=center] { Game Title }
[box direction=column] {
[box .menu_item] { Start Game }
[box .menu_item] { Options }
[box .menu_item] { Quit }
}
}
[box .card width=300 padding=15 bg-color=#ffffff] {
[box] { Card Title }
[box] { Card content goes here... }
[box direction=row justify-content=end] {
[box .button] { OK }
[box .button] { Cancel }
}
}
[box direction=row] {
[box width=30%] {
Sidebar
}
[box width=70%] {
Main content
}
}
[box width=50% height=50%] {
Half size box
}
[box width=10em height=2em] {
Sized with em units
}
[box width=fit-content] {
This box sizes to content
}
[box direction=row width=300] {
[box width=100] { Fixed size }
[box grow=1] { Fills remaining space }
}
Left-fill-right (fixed on both sides, growing middle):
[box direction=row width=400] {
[box width=100] { Left }
[box grow=1] { Middle }
[box width=100] { Right }
}
Split remaining space in a 2:1 ratio:
[box direction=row width=400] {
[box grow=2] { Gets 2/3 }
[box grow=1] { Gets 1/3 }
}
[box bg-color=#ff5733] {
Orange background
}