Layout
How the backend dresses a widget: margins, padding, corners, backgrounds, gradients, borders and width.
Widgets never style their own containers. The backend sends a layout object and the renderer applies it uniformly, which is what keeps a server driven app visually consistent and instantly restylable.
The chrome object#
Application order#
Chrome is applied inside out, always in the same order:
- Padding between the widget's content and its background edge.
- Background and gradient fill. A gradient paints over the background color when both are present.
- Corner clipping, uniform or per corner.
- Border, solid or dashed.
- Margin outside everything.
Because the order is fixed, the same JSON renders identically everywhere: pages, sheets, carousels and nested containers.
Corner radius#
Send a bare number to round every corner, or an object to control each one:
Width#
width decides how much horizontal space a widget claims:
| Value | Behavior |
|---|---|
"fill" | Stretch to the full available width. |
"hug" | Let the content decide. |
0.75 | A fraction of the container. Inside carousels this produces peeking cards. |
Dashed borders#
Add dash_width and dash_gap to a border for dashed strokes: