Tabs, sections & review
A customer record is not a process to walk through in order. The same steps a wizard uses can be shown as tabs, an accordion or titled sections the user moves around in freely - and a review step reads every answer back in words, with a way back to change it.
View source
@page "/tabs-review"
<BormView State="_state" OnValidSubmit="HandleSubmit" SubmitText="Save record" ShowErrorSummary="true" />
@code {
private readonly CustomerRecord _model = new();
private BormState _state = default!;
protected override void OnInitialized()
{
var schema = BormBuilder.For<CustomerRecord>()
.Title("Customer record")
.StepLayout(BormStepLayout.Tabs) // or Accordion, Sections, Wizard
.Field(x => x.Name, f => f.Required())
.Field(x => x.Email, f => f.Required().Email())
.Field(x => x.Phone, f => f.Autocomplete("tel"))
.Field(x => x.Plan, f => f.AsRadio()
.Options(("solo", "Solo"), ("team", "Team"), ("enterprise", "Enterprise")))
.Field(x => x.Seats, f => f.Range(1, 500).VisibleWhen("{Plan} != 'solo'"))
.Field(x => x.BillingFrom, f => f.AsMonth().Required()) // DateOnly: the 1st of the month
.Field(x => x.Paperless)
.Field(x => x.KickoffWeek, f => f.AsWeek()) // string: "2026-W44"
.Field(x => x.Notes, f => f.AsTextArea(3))
.Review("summary", "Check the record")
.Step("contact", s => s.Title("Contact").Fields("Name", "Email", "Phone"))
.Step("plan", s => s.Title("Plan & billing").Fields("Plan", "Seats", "BillingFrom", "Paperless"))
.Step("onboarding", s => s.Title("Onboarding")
.Fields("KickoffWeek", "Notes")
.VisibleWhen("{Plan} != 'solo'"))
.Step("review", s => s.Title("Review").Fields("summary"))
.Build();
_state = new BormState(schema, new BormModelDataAccessor(_model));
}
public void Dispose() => _state.Dispose();
}The four layouts
| Layout | How the user moves |
|---|---|
Wizard | One step at a time, each validated before the next - the default. See the wizard. |
Tabs | Any tab, in any order, without validating the one left. One tab stop for the list; arrow keys, Home and End between tabs. |
Accordion | The browser's own <details>, the first open. A closed section keeps its fields in the page, so nothing in it is lost. |
Sections | Titled regions one after another, all open. |
Outside the wizard, Submit validates everything - a hidden tab or section never blocks it - and Enter in a text box
submits. A failed submit turns to the first tab with something to fix, or opens every section that has something.
x-stepLayout carries the choice through JSON Schema, and a draft remembers which tab was open.
The review
Review(name, heading) adds a "check your answers" field; put it on the last step. Every answer of every
other visible step is read back in words - an option's label rather than its stored value, Yes or No, a number with its
prefix and suffix, a date as the reader's culture writes it, a file by its name, a repeater row by row - and a question
nobody answered says so. A sensitive answer (a password, a field marked Sensitive()) is never shown. Each
step has a Change button, named for the step, that takes the user back to it.
<BormReview State="state" /> places the same summary anywhere - a confirmation page, a printable
record. <BormStepsView> renders the tabs, accordion or sections for a page that composes its own form.
In JSON Schema a review is a static field with "x-attributes": {"review": true}.