Skip to content
Forms, switch product

Flex

Forms that use flex, and the gui.layouts.flex, horizontalFlex and verticalFlex builders, still work: a flex layout renders as a grid. Move them to grid the next time you edit the form.

Before
gui.layouts.horizontalFlex([cancel, save], { gap: 8, align: 'end' });
gui.layouts.verticalFlex([name, email]);
After
gui.layouts.horizontalGrid([cancel, save], { gap: 'sm', justify: 'end' });
gui.layouts.grid([name, email]);
Before
{
"kind": "layout",
"type": "flex",
"props": { "direction": "row", "gap": 8, "align": "end" }
}
After
{
"kind": "layout",
"type": "grid",
"props": { "direction": "row", "gap": "sm", "justify": "end" }
}

This is how a flex layout renders today, and what to write instead:

FlexGrid
type: 'flex', direction: 'column' or nonetype: 'grid'
type: 'flex', direction: 'row'type: 'grid', direction: 'row'
row-reverse, column-reverseNot supported: they render in source order. Reorder the children
gap in pixelsgap, a step from 'none' to 'xl'. Pixels become the nearest step
alignjustify. space-around and space-evenly become space-between
justifyNothing: the grid lines up the fields’ labels, controls and errors
a child’s sizeThe same size, in a row
gui.layouts.horizontalFlex(…)gui.layouts.horizontalGrid(…)
gui.layouts.flex(…), verticalFlex(…)gui.layouts.grid(…), verticalGrid(…)

The reversed directions render in source order because, with them, screen readers and the keyboard went through the fields in a different order from the one on screen.

The .gui-flex classes are gone too: a flex layout renders the grid’s markup. The migration guide lists the other layout changes of 2.0.