Repository navigation
Conversation
…lates Add FormLayout, a grid for form fields that reflows by the width of its container, so one form definition fits a Dialog, a Sheet or a page. FormLayout.Section groups fields as cards or plain fieldsets, and FormLayout.Actions is a sticky action bar for long page forms. Supporting changes: - span on Field.Root and Fieldset.Root; a field holding a Textarea takes the full row unless it sets its own span - Field.Label required (visual marker) and Field.Value (a read-only value at an input's height) - Dialog.Content size (sm-xl, matching Sheet) and Dialog.Body, which scrolls long content while the header and footer stay in view - Dialog.Footer and Sheet.Footer right-align buttons at their natural width - Layout maxWidth to centre and cap a page The example app gets a form templates page (modal, side sheet, page form with an optional section nav, document form, and a wizard built on Stepper, in a dialog or on a page) and five larger examples. The form/wizard pattern now uses Stepper for its step indicator. Docs, form patterns and the consumer skill are updated. Refs tailor-inc/platform-planning#1742 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> # Conflicts: # docs-manifest.json # docs-src/patterns/form-wizard.docs.examples.tsx # docs-src/patterns/form-wizard.docs.outline.md # docs/patterns/form-wizard.md
Add Stepper for wizard steps, approval stages, quality gates and other fixed sequences. Each step has a status (complete, current, upcoming, skipped), an optional badge and an optional description, and the line between steps fills up to the furthest step reached. The current step gets aria-current="step"; the others announce their status in English or Japanese. It lays out horizontally or vertically. A horizontal Stepper scrolls sideways when its steps don't fit and, below 400px of container width, shows only its markers with "Step 2 of 4" and the current step's label. onStepClick makes completed steps clickable. The Stepper only displays progress; the page decides each step's status. The example app gets a Stepper showcase page. Refs tailor-inc/platform-planning#2178 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Replace the width table with seven rules (size by the value, not the label; one short value takes one column; a long or two-part value takes two; free text and non-values take the full row; keep related fields together; don't widen to fill a row; don't size for mobile), with the table kept as examples. The agent skill carries the same rules so agents see them without opening the FormLayout reference. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts: # docs-manifest.json
# Conflicts: # docs-manifest.json # docs-src/components/form.docs.outline.md # docs/components/form.md
Stepper ships in its own PR. Take its component, docs and showcase out of this branch, and with them the wizard template and the wizard pattern rewrite, which depend on it. The form/wizard pattern stays as on main. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Five sections, four of them long enough to scroll past and one short, so the section nav has somewhere to jump. The address block moves to the shared fields so the page form and complex examples use one copy. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Code Metrics Report
Details | | main (923933d) | #708 (557a69b) | +/- |
|---------------------|----------------|----------------|-------|
+ | Coverage | 62.9% | 62.9% | +0.0% |
| Files | 294 | 296 | +2 |
| Lines | 13483 | 13532 | +49 |
+ | Covered | 8485 | 8525 | +40 |
+ | Test Execution Time | 4m3s | 3m51s | -12s |Code coverage of files in pull request scope (16.3% → 16.9%, patch 100.0%)
Reported by octocov |
# Conflicts: # docs-manifest.json
# Conflicts: # docs-manifest.json # docs-src/components/dialog.docs.outline.md # docs/components/dialog.md
- ActivityCard's "All activities" list scrolls in `Dialog.Body`. Only the body shrinks in the new flex-column `Dialog.Content`, so a plain scroll child grew to full height and scrolled the whole dialog, title included. Regression test added. - Changeset and a 1.21.0 migrations entry tell apps that built their own flex-column dialog body to use `Dialog.Body`; the changeset also says footer buttons now show in source order. - Dialog test now checks the body scrolls while the header and footer stay pinned, instead of a className flex column that no longer behaves so. - Main's live Dialog form example uses `Dialog.Body`, a footer submit with `form`, and `FormLayout`. - The wizard pattern's steps use `FormLayout` instead of hand-written grids, matching the skill rule. - Demo overview no longer mentions editing in place (that's #709). - Comment: a card section's grid is 48px narrower than the width its thresholds measure. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
I would prefer to start by extending Grid, since we already have it as a general-purpose layout component, rather than introducing a parallel layout API specifically for forms. We could then describe how to compose Grid, Card, Fieldset, and the existing form controls in our skills and documentation. That would give consumers and coding agents a clear recommended approach without adding another set of public components. If concrete gaps remain after that, we can consider a form-specific abstraction. Looking at the implementation, the missing Grid capabilities seem to be:
These additions would cover FormLayout's core responsive grid behavior. The remaining layout features are largely already available:
For the rest, I would start with composition patterns in our skills and examples:
I would also defer Field.Value, since it is independent of the layout problem. Could we focus this PR on the reusable Grid improvements and the recommended composition patterns first, then reassess whether a separate FormLayout is necessary? |
What
A form layout layer for AppShell. Until now every form hand-wrote its own
max-w-2xl,grid md:grid-cols-2,md:col-span-2and Card-per-section. The result was single-column forms with "oceans of white space", and no shared answer to where a form should live.Refs tailor-inc/platform-planning#1742, tailor-inc/platform-planning#1391
FormLayoutlays out fields in a grid that reflows by its container's width. Column breakpoints are container queries at 400, 640 and 880px, andcolumnsis the maximum. One field definition therefore fits a Dialog, a Sheet or a page.New API
FormLayout:columns1–4, the maximum. It's a container-query grid.FormLayout.Section: a fieldset group,cardorplain, withtitle,description,action, its owncolumnsanddisabled. The title is a real heading inside the legend, and the description is linked witharia-describedby.FormLayout.Item: non-field content (an Alert or a table) with aspan.FormLayout.Actions: right-aligned buttons, optionally a sticky floating bar.spanonField.RootandFieldset.Root:2 | 3 | "full", styled only inside FormLayout. A field holding aTextareatakes the full row by default.spanworks only on a direct child of the grid; the docs say so.Field.Label required: a visual-only required marker.Field.Value: a read-only value in the control's place, at an input's height so it lines up with editable fields. It's named by its label.Layout maxWidth:"md" | "lg" | "xl", a centred page with a capped width.Dialog.Content size:"sm" | "md" | "lg" | "xl", defaultmd, matchingSheet.Content. Every size keeps a 1rem margin on each side.Dialog.Body: scrolls long content while the header and footer stay in view.FormLayout,FormLayoutProps,FormLayoutSectionProps,FormLayoutItemProps,FormLayoutActionsProps.Changes to existing components (please check)
Dialog.Contentis a flex column instead of a grid, soDialog.Bodycan scroll.Dialog.Bodydon't shrink, so a tall dialog without aBodystill scrolls as a whole.Dialog.Contenta flex column itself and gave a childmin-h-0 flex-1 overflow-y-auto(what main's Dialog docs used to suggest) now scrolls as a whole instead, header included. Wrap that content inDialog.Body.ActivityCard's "All activities" dialog did this and is fixed here, with a regression test. There's a 1.21.0 migrations entry.Dialog.FooterandSheet.Footernow right-align their buttons at their natural width at every size.Sheet.Footerstacked buttons full width, andDialog.Footerdid so belowsm.All of this is in the changeset and, for the dialog scroll change, the migrations guide.
Docs
form/*patterns (modal, sectioned, single-page) using FormLayout. The wizard pattern's steps also use FormLayout instead of hand-written grids; its step indicator is unchanged here (see Stack).Dialog.Body, and the live form example usesDialog.Body, a footer submit withform, and FormLayout. Layout documentsmaxWidth.Demo (
/showcase/form-templates, now in the sidebar)Every template uses the same purchase-order fields; only the container and the column count change.
Layout maxWidth="xl", line items edge to edge).Attachment), date range and read-only values.Open questions for review
spanlives: onField.Root(no wrapper needed) or only onFormLayout.Item?FormCardsharing DescriptionCard's field config). It isn't in this PR.Testing
Field.Valuelabellingcheck-dts.Stack
This PR now ships on its own, so Stepper and EditableCard can't hold up the forms release.
mainand no longer contains Stepper. Stepper (feat(stepper): show progress through a fixed sequence of steps #707) is a separate PR onmain.🤖 Generated with Claude Code