CxJS

Inner Layouts

Inner layouts define how a widget’s children are arranged. They are typically used as container components.

LayoutPurpose
LabelsLeftLayoutHorizontal form layout with labels on the left
LabelsTopLayoutForm layout with labels above inputs
FirstVisibleChildLayoutShows only the first visible child
UseParentLayoutDelegates layout to the parent container

Default Behavior (No Layout)

When no layout is specified, children render in the order they are defined. For form fields, this means the label appears inline before the input:

<div>
  First some text.
  <TextField value={m.text} label="Label 1" />
  <Checkbox value={m.check} label="Label 2">
    Checkbox
  </Checkbox>
</div>
First some text.

This default behavior doesn’t work well for structured forms. Use a layout component to arrange form fields properly:

<LabelsLeftLayout>
  First some text.
  <TextField value={m.text} label="Label 1" />
  <Checkbox value={m.check} label="Label 2">
    Checkbox
  </Checkbox>
</LabelsLeftLayout>
First some text.