section
Learn how to use the section component in your user interface to group related items together.
The section component groups related items together under a single title. A section can be set up on a jig.default under the entity component or on a form component as its container. The component can contain field-row and entity-field components or children components on a form component.
A component.section can be set up with the following combinations:
An entity containing sections with rows and entity-field for display purposes.
An entity containing sections and entity-field for display purposes.
A form component containing sections with rows and children for display/capturing purposes.
A form component containing sections and children components for display/capturing purposes.
Horizontal lists cannot be used with the section components as an empty white jig will be displayed.
Some properties are common to all components, see Common component properties for a list and their configuration options.
Examples and code snippets
The Entity with sections, rows, and entity fields (Display only)

Using sections, rows, and entity fields to create relevant display sections for the information to be functional yet elegant and neatly organized.
Examples: See the full example using static data in GitHub See the full example using dynamic data in GitHub.
Datasources: See the full datasource for static data in GitHub. See the full datasource for dynamic data in GitHub
children:
- type: component.entity
options:
children:
- type: component.section
options:
title: Repair Services
children:
- type: component.field-row
options:
children:
- type: component.entity-field
options:
label: Service
value: [email protected][id=1].service
- type: component.field-row
options:
children:
- type: component.entity-field
options:
label: Description
value: [email protected][id=1].description
isMultiline: true
- type: component.section
options:
title: Rates
children:
- type: component.field-row
options:
children:
- type: component.entity-field
options:
label: Hourly Rate
value: [email protected][id=1].hourlyRate
- type: component.entity-field
options:
label: Time
value: [email protected][id=1].time & ' minutes'
- type: component.entity-field
options:
label: Materials
value: =(@ctx.datasources.repair-services-static[id=1].materials = 'True' ? true :false)
contentType: checkbox
Section-rows-entity-fields (dynamic)
children:
- type: component.entity
options:
children:
- type: component.section
options:
title: Cleaning Services
children:
- type: component.field-row
options:
children:
- type: component.entity-field
options:
label: Service
value: [email protected][0].service
- type: component.entity-field
options:
label: Area
value: [email protected][0].area
- type: component.field-row
options:
children:
- type: component.entity-field
options:
label: Time
value: [email protected][0].time & ' minutes'
- type: component.entity-field
options:
label: Indoor
value: [email protected][0].indoor
contentType: checkbox
- type: component.field-row
options:
children:
- type: component.entity-field
options:
label: Description
value: [email protected][0].description
isMultiline: true
- type: component.section
options:
title: Rates
children:
- type: component.field-row
options:
children:
- type: component.entity-field
options:
label: Hourly Rate
value: [email protected][0].hourlyrate != null ? @ctx.datasources.cleaning-services-dynamic[0].hourlyrate:'N/A'
- type: component.entity-field
options:
label: Once Off Rate
value: [email protected][0].onceoffrate != null ? @ctx.datasources.cleaning-services-dynamic[0].onceoffrate:'N/A'Form with sections, rows, and children components (Display and input)

Entity with sections and entity-fields (Display only)

This is another example for display purposes only, but this time without the rows. Note the difference in the fields as they now display below each other instead of numerous entity-fields in a row.
Examples: Basic- See the full example using static data in GitHub. Compact - See the full example using static data in GitHub.
Datasources: See the full datasource for static data in GitHub. See the full datasource for dynamic data in GitHub.
Form with sections and entity-fields (Display and input)

Last updated
Was this helpful?