Skip to content

Foldout

Status: ✅ Implemented · Redwood template: Foldout layout (oj-sp-foldout-layout + oj-sp-foldout-panel; Redwood files it under Details)

A foldout page shows one business object — or one running process — as a row of panels. The first panel is the overview: who or what this is, and its key facts. Each further panel holds one category of information that belongs to it (payments, history, contacts, notes…). The user reads across the row, folds panels away to make room for others, and keeps the overview in sight the whole time.

In Mateu this is the Foldout archetype: the first component field is the overview, every @Panel field is a fold-out panel.

  • Record workspaces where the user works one object at a time and hops between two or more categories of associated information — reservations, contracts, patient records, an employee.
  • When seeing several categories side by side matters more than seeing one in depth.

Prefer @Tab when categories are mutually exclusive and context loss is acceptable, the Item overview when one tabbed area is enough, or MasterDetailView when the “categories” are really alternative detail parts of a master form.

The foldout layout painted by the Redwood renderer: navigation header, overview panel and three fold-out panels

#RegionWhat it holdsMateu piece
1Navigation headerGo back to the parent, move to the previous / next object of the same kind, optional searchnavigationHeader() → FoldoutNavigation
2Overview panelThe object’s identity and key information (avatar, name, contact details…), with an optional Edit actionthe first component field without @Panel; headerTitle() (defaults to @Title); a List<Badge> field; overviewEditActionId()
3Fold-out panelsOne category of associated information each; a folded panel shows only its title (and a short summary)component fields with @Panel(title, subtitle, icon, open); panelSummary(field)
4Drill-downA deeper level opened from a panel, inside the same layout— not supported

Orientation. By default (vertical) the overview is the first column at the left of the panels. With orientation() = FoldoutOrientation.horizontal the overview becomes a band across the top and the panels run below it.

The layout is a horizontal carousel: open panels sit side by side, the row scrolls sideways when they do not fit, and page dots show where the user is. On narrow screens one panel fills the width at a time. On Redwood all of this is Spectra’s own oj-sp-foldout-layout; the Vaadin shell draws the same carousel (mateu-vaadin-foldout), and the native renderers show the panels as an accordion.

A panel declared open = false starts folded as a narrow strip with its title; selecting it (click, keyboard focus or its page dot) unfolds it.

A panel whose open state was not decided — a YAML FoldoutPanel with no open: (the wire’s autoOpen) — is open while it fits: the renderer counts the overview, the panels declared open and a strip for every other panel, then opens the undecided ones in declaration order while the row still has room for each one’s width (width, else 22rem), and folds the rest. It re-decides when the window is resized; a panel the user unfolds or folds by hand keeps that state until the next page. So a wide window shows two or three panels open, a laptop one or two, and a phone only the ones the author declared open. The rule is the same in every renderer, pinned by conformance/client/foldout-auto.json. Java panels (@Panel, the fluent builder) always say what they want, so they are never automatic.

A panel taller than the window scrolls inside on Redwood (Spectra fixes every panel to the row’s height; the wheel over a panel scrolls it while it has room, then pages the row). On the Vaadin shell the panels grow with their content and the page scrolls.

Legend: ✅ supported · 🟡 partial · ❌ not supported · ➖ not applicable

ElementMateu pieceRedwoodNotes
Page widthedge to edge by default (Foldout.pageWidth()); @PageWidth overrides✅
Orientation (vertical / horizontal)orientation()✅horizontal uses the layout’s overview slot
Go to parentFoldoutNavigation.parentLabel + parentActionId✅
Previous / next objectFoldoutNavigation.previousActionId / nextActionId✅both arrows show once previousActionId is set
Search in the header—❌
Overview titleheaderTitle() / @Title✅the overview panel’s title
Overview badgesa List<Badge> field (headerBadges())🟡painted as JET badges at the top of the overview, all neutral (the badge colour is not used)
Overview Edit actionoverviewEditActionId()✅the panel’s own pencil action
Panel title@Panel(title)✅defaults to the field label
Panel subtitle@Panel(subtitle)🟡joined to the title (“Payments · Charges and refunds”)
Panel icon@Panel(icon)🟡Spectra’s panel has no icon; Mateu draws a decorative one beside the title
Panel widthFoldoutPanel.width (fluent)✅
Starts folded@Panel(open = false)✅
Open while it fitsYAML FoldoutPanel with no open: (autoOpen)✅folds when the row runs out of room; re-decided on resize
Summary on the folded strippanelSummary(field) / FoldoutPanel.summary🟡a line Mateu draws under the title, not the panel’s summary slot
Panel actions— (only the overview has Edit)❌put buttons inside the panel content
Recommendation area—❌
“No data” stateEmptyState as the panel content🟡
Drill-down—❌
Page header with actions@Toolbar methods✅a foldout with toolbar actions keeps the regular page header above the layout

Extend Foldout. The first component field is the overview (always visible, left); each component field annotated with @Panel becomes a fold-out panel. Closed panels render as a narrow strip with the rotated title; clicking a strip folds the panel out, and several panels can be open side by side (the row scrolls horizontally when it overflows).

@UI("/booking/:id")
@Title("Booking 2026-08117")
public class BookingFoldout extends Foldout {
Markdown overview = new Markdown("""
### Booking 2026-08117
**Guest:** Jane Smith
**Dates:** 12–19 Aug 2026
""", null, null);
@Panel(title = "Payments", subtitle = "Charges and refunds")
Markdown payments = new Markdown("...", null, null);
@Panel(title = "Occupancy")
Chart occupancy = Chart.builder().chartType(ChartType.line) /* … */ .build();
@Panel(title = "Notes", open = false) // starts folded
Markdown notes = new Markdown("...", null, null);
@Override
public FoldoutNavigation navigationHeader() {
return FoldoutNavigation.builder()
.parentLabel("Bookings").parentActionId("backToBookings")
.previousActionId("previousBooking").nextActionId("nextBooking")
.build();
}
@Override
public String overviewEditActionId() {
return "editBooking";
}
@Action Object backToBookings() { return URI.create("/bookings"); }
@Action Object previousBooking() { return URI.create("/booking/2026-08116"); }
@Action Object nextBooking() { return URI.create("/booking/2026-08118"); }
@Action Object editBooking() { return URI.create("/booking/2026-08117/edit"); }
}

Booking foldout

@Panel attributes on foldout pages: title (defaults to the field label), subtitle, icon, and open (initial state, default true).

Build a FoldoutLayout directly from ComponentTreeSupplier when panels are data-dependent:

@Override
public Component component(HttpRequest request) {
return FoldoutLayout.builder()
.overview(overviewCard())
.panels(List.of(
FoldoutPanel.builder().title("Payments").width("40rem").content(paymentsGrid()).build(),
FoldoutPanel.builder().title("Notes").open(false).content(notes()).build()))
.build();
}

FoldoutPanel.width is an optional CSS length for the expanded panel — unset panels keep the renderer’s default section width (--mateu-foldout-panel-flex / --mateu-foldout-section-width, 22rem). Use it to size panels to their content: a wide checklist or grid next to a narrow property list.

Two Vaadin-carousel behaviours worth knowing:

  • The scroll affordances (the round left/right buttons at the bottom corners) only appear when the sections genuinely overflow the viewport — a few residual pixels (a scrollbar’s width, rounding) don’t summon them, and the carousel re-measures as slotted content settles or the window resizes.
  • The last fold never renders narrower than the overview column: a skinny accessory panel (say a 14rem profile strip) widens to match the first fold, so the page reads as balanced columns instead of trailing off into a sliver.

A folded panel is a narrow strip with its rotated title. Give it a summary — a count, a status, an amount — so the user can tell whether it is worth opening:

@Override
protected Component panelSummary(String panelFieldName) {
return switch (panelFieldName) {
case "payments" -> new Text("payments-summary", "€240 due");
case "requests" -> new Text("requests-summary", "2 open");
default -> null;
};
}

Fluent: FoldoutPanel.builder()....summary(component). It travels as the child slotted summary-N and is drawn in the strip under the title; renderers whose panels never fold (the React Native accordion keeps it under a closed panel’s title, IntelliJ under the panel heading) show it as a one-line digest. Redwood draws the summary’s texts as one line under the panel title.

Folded panels showing their summary

Java.NETPythonVaadinRedwoodReact NativeIntelliJ
Overview + fold-out panels, orientation, navigation header✅✅✅✅✅✅✅
Folded-panel summary✅✅✅✅✅✅✅

A YAML page fills the template with template: {type: FoldoutPage} on its type: Form: the always-visible overview slot, and the form’s content as the panels (FoldoutPanels; a summary shows on the folded strip, ${state.x} interpolated) — see Page templates. The page header is the form’s.

type: Form
title: ${state.name}
template:
type: FoldoutPage
overview:
- {type: Avatar, name: "${state.name}", image: "${state.image}"}
- {type: FormField, id: model, label: Model, readOnly: true}
content:
- {type: FoldoutPanel, title: Specifications, open: true, content: {type: FormField, id: length, label: Length, readOnly: true}}
- {type: FoldoutPanel, title: Crew & cargo, summary: {type: Text, text: "Crew ${state.crew}"}, content: {type: FormField, id: crew, label: Crew, readOnly: true}}

open: true keeps a panel open and open: false starts it folded, whatever the width. A panel with no open: (Crew & cargo above) is open while it fits the row and folded otherwise — see Responsive behaviour. autoOpen: true says the same explicitly.

What the Redwood foldout-layout and foldout-panel components expose, and what Mateu gives you for them. The canonical page-header elements shared by every template are documented once in Page templates.

Legend: ✅ supported · 🟡 partial · — not supported · ⚪ deliberately out of scope

Redwood prop / slotMateu
orientation: horizontal | verticalorientation() → FoldoutOrientation.vertical (default: the overview is the first column, left of the panels) | horizontal (the overview is the band across the top — Redwood’s overview slot — and the panels run below it)✅
nextStep / previousStep + spPrevious / spNextnavigationHeader() → FoldoutNavigation.previousActionId / nextActionId✅
displayOptions.goToParent + spGoToParentFoldoutNavigation.parentLabel / parentActionId✅
Slot overviewthe first component field (always visible)✅
Slot default (the panels)component fields annotated @Panel, or FoldoutLayout.panels✅
Slot drilldown——
Slot searchthe app-level smart search bar / ⌘K palette, not a page slot🟡
selectedPanel (controlled selection)@Panel(open = …) / FoldoutPanel.open set the initial state — the component has no folded state, so an open = false panel starts as a strip (title + summary) and selecting it (click, keyboard focus, its page dot) unfolds it; the selection is not a controlled prop afterwards🟡
animatethe renderer animates folding; not configurable🟡
displayOptions.bidirectionalNavigationon when FoldoutNavigation.previousActionId is set (both arrows drawn)✅
displayOptions.background: default | transparent— the Redwood renderer always uses transparent (style/cssClasses escape hatch)—
displayOptions.inFlowBack + spInFlowBack——
Redwood prop / slotMateu
panelTitle@Panel(title) / FoldoutPanel.title (defaults to the field label)✅
—subtitle, icon, width are Mateu additions with no Redwood equivalent (the Redwood renderer joins subtitle to the title and draws icon in the panel’s top-end corner, beside its title)✅
Slot default@Panel field value / FoldoutPanel.content✅
Slot summary (what shows on the collapsed strip)panelSummary(panelFieldName) / FoldoutPanel.summary — Redwood draws it as a line in the default slot, because the component reads its summary slot only once, before the page binds it🟡
Slot recommendation——
Slot noData— compose an EmptyState as the panel content🟡
secondaryActions + spAction {actionId}the overview panel’s Edit pencil: overviewEditActionId(); other panel-level actions live inside the panel content🟡

The element-by-element review, with code references, is in foldout-layout review. In short:

  • No drill-down level, no search in the navigation header, no recommendation area.
  • Panels other than the overview cannot declare their own header actions.
  • On Redwood the folded-strip summary and the panel icon are drawn by Mateu, not by Spectra’s slots.

See it live in the Explorer: Foldout · Foldout page · Foldout layout