Skip to main content

CnSectionsWidget

Several widgets in one place, each under its own heading. Registered under the sections widget type.

A tab strip binds one widget per tab, and a tab often holds more than one thing: a case's documents list and its folder, a portal's details form, house style and sign-in settings. Before this widget each app wrote a component that stacked its own panels (dossiq CaseSectionsWidget, portaliq PortalSettings). Now the manifest lists the sections.

Two looks:

  • Headed sections (default): a heading per section and a 1px rule between sections, inside the tab panel (DqZaak's folded tabs).
  • Cards (cards: true): one card per section, optionally in a main and a side column (column: "side"), 20px apart, the side column at most 418px (PtPortalInstellingen).

A single column of separate titled cards in a tab is also the tabs widget's own widgetIds stack (see CnTabsWidget); use sections for headed sections, and for the two-column card grid a settings tab draws.

Content shape​

{
"id": "portal-settings",
"type": "sections",
"content": {
"cards": true,
"sections": [
{ "title": "Gegevens van de portal", "widgetId": "portal-details" },
{ "title": "Huisstijl", "widget": { "type": "PortalTheme" } },
{ "title": "Verkeer meten", "column": "side", "widgetId": "portal-traffic-settings" }
]
}
}
KeyMeaning
sections[]{ key?, title?, description?, column?, widget? | widgetId? }, in order. label is an alias of title. widget is any widget definition; widgetId names a sibling definition on the same surface. A section whose widget is missing or whose id names nothing is skipped (the id case with a console warning).
sections[].columnmain (default) or side. One side section makes the layout two columns.
cardsOne card per section (default false: headings and a rule).
hideEmptyA section whose widget draws nothing shows no heading and takes no space (default true). Its widget stays mounted, so it can still fetch and fill later.

Titles and descriptions go through the host app's cnTranslate.

Props​

PropTypeDefaultDescription
contentobject{}The configuration above.
availableWidgetsobject[][]Sibling widget definitions, for widgetId sections. The detail page and the tabs widget pass them (it is a container type).
objectIdstring|number''The bound record's id, forwarded to every child.
objectDataobjectnullThe loaded record, forwarded to every child.
objectTypestring''The object-type slug, forwarded.
schemaObjectobjectnullThe JSON Schema, needed by a data child.
registerstring|object''Register slug of the surface.
schemastring|object''Schema slug of the surface.
storeobjectnullThe object store, forwarded.
surfacestring'detail-page'Rendering surface, forwarded.
integrationContextobjectnullObject context for integration children.
cnRegistryobject{}The app's component registry, for custom child types.

Notes​

  • Children render through CnDetailWidgetHost in bare mode, the dispatch a tab panel uses, so a child behaves here as it does in a tab.
  • Stacked children share one cell, so an object list in a section renders every fetched row: the widget sets content.fit: false on a child that does not set fit itself.
  • "Draws nothing" means no text (an empty state is text, so it counts as content) and no image, svg, canvas, table or form control.
  • Each shown section is labelled by its heading (aria-labelledby).
  • The tabs widget now passes its sibling definitions to a panel's widget, so a sections widget inside a tab can use widgetId.
  • Renderer only: no config form; detail pages only.