Layout components
The next generation content form includes two ways of specifying the layout of a form: tabs and grids. These features allow you to specify how properties in the form are laid out and to make the form easier to use by grouping related properties together.
GridsLink copied!
The grid component allows you to group related properties in columns and specify how these columns should be displayed.
ParametersLink copied!
Param | Type | Description |
---|---|---|
name | string | grid |
numColumns | integer | The number of columns in each row. |
columns | array | The span of each group of columns and the properties it contains |
The span
parameter specifies how many columns each column group takes up. Each item in the columns
arrays includes span
and a pointers
array containing the properties contained within it.
Grid exampleLink copied!
In the example schema shown below, the image properties are grouped together in a grid divided into 12 columns, with each property laid out using 6 columns, or half the available space.
Grid example content formLink copied!
The content form for the example grid schema is shown below. The Image Link and Image SVG are aligned in one section of the grid, while Image Alt Text, Image URL and Image Link target are grouped on the other.
TabsLink copied!
The tabs component allows you to organise your form so it can be navigated using tabs. You may choose to add advanced options in a separate tab and keep the most commonly used properties in the main tab, for example.
Specify the tab labels, the default tab and the properties that will be included in each tab.
You can find a more advanced tabs example, with vertical tabs, in the schema examples.
ParametersLink copied!
Parameter | Description |
---|---|
name | tabs |
defaultTab | The name of the tab that will be selected initially |
orientation | How the tabs are displayed. horizontal (default) or vertical |
variant | default or outline . Should an outline be displayed around the selected tab. |
grow | true or false (default). Should the tabs expand to fit the size of the form. |
items | An array of tabs. For each entry in the items array there is a label and a pointers array that contains the property names in JSON pointer format. See example. |
Tabs exampleLink copied!
In the simple schema shown below, there are two tabs: image and video, each containing a property for the media itself and a string field.
Tabs example content formLink copied!
The content form for the example schema is shown below, including the "image" and "video" tabs.
DividerLink copied!
A divider is a line of variable width, with an optional label. It’s particularly useful for labelling groups of properties to create notional sections that don’t impact output.
ParametersLink copied!
Param | Description |
---|---|
name | divider |
label | The label shown on the divider |
labelPosition | The divider label alignment. left , right or center (default). |
size | The divider line size. xs (default), sm , md , lg , xl or xxl . Note that the size of the label will not be changed |
variant | The divider line style. dotted or dashed . A solid line will be used by default if variant is not specified |
Divider exampleLink copied!
In the example below, the numberDivider
property includes a label and has a line size set to medium. The divider will not be included in the JSON output for the content item.
In this example the divider acts as a heading for a group of number properties (taken from the number schema example).
Divider example content formLink copied!
The content form for the example schema is shown below. The divider property provides a heading for the properties underneath.