For AI agents: the complete documentation index is available at https://wallarm.github.io/design-system/llms.txt, the full documentation bundle is available at https://wallarm.github.io/design-system/llms-full.txt, and this page is available as Markdown at https://wallarm.github.io/design-system/patterns/create-edit-forms.md.

Create and edit forms

Components: Dialog, Drawer, Field, Input, Textarea, Timeline, Stepper, Button

+7 more

VStack, Tooltip, Alert, Table, InlineEdit, Attribute, Toaster

Form size picks the container.

When to use

NeedUseNot
Up to 6 fields, one concern (create user)Dialog with no width (560)A Drawer for three inputs
Dependent sections seen together (create provider)Drawer width={700} + Timeline with numbered sectionsA Stepper hiding sections
Gated parts, each needs the previous (create policy)Drawer with no width (640) + StepperOne long Timeline with 20 fields
Pick many rows ("Add users to group")Dialog width={960} with a selectable TableA 200-item multi-select
Edit one value on a detail viewInlineEdit on the AttributeA drawer for one field
Independent values saved one by oneSettings pageA drawer opened from the page
A yes/no before an actionConfirmation dialogsA form dialog with no fields
  • Edit uses the same container as create.
  • There is no Form, FormDialog, FormDrawer, Wizard, vertical Stepper or form-level validation component.

Rules

Container and layout

  • Wrap body and footer (or the whole Stepper) in <form className='flex min-h-0 flex-1 flex-col'> so Enter submits.
  • Size with width (400 to 1130): Dialog 560 default, 400/960 presets; Drawer 640 default, 700 for Timeline forms. There is no size prop or exported size constant.
  • Bodies own their padding. Never add p-*, px-* or py-* around their content.
  • Never pass className to DrawerHeader, DrawerBody, DrawerFooter, their Dialog* aliases, or Field. Size the control or grid cell instead.
  • Never add a close X; the header has one.
  • Space fields with <VStack gap={24}> in a dialog and <VStack gap={12}> in a drawer section. Not FieldGroup (fixed 16px). There is no gap prop on Field or TimelineContent.
  • Never style FieldGroup, FieldLabel or FieldDescription with className; it is ignored.
  • Add className='py-16' to StepperContent.
  • If two related fields are short (name and ID, port and protocol), put them in grid grid-cols-2 gap-12. URLs, secrets and free text get full width.
  • Number Timeline sections in TimelineIndicator; title them with a noun phrase.
  • Stepper wraps DrawerBody and DrawerFooter; its Prev/Next triggers work only inside it. Give it className='flex min-h-0 flex-1 flex-col'.
  • Inside Stepper: StepperList aria-label='…' (one StepperItem index status per step), then DrawerBody holding one StepperContent index per step, then DrawerFooter.
  • Max 6 Stepper steps. Vertical numbered sections are a Timeline, even if Figma says "stepper".

Fields

  • Wrap every control in Field; never a bare <label>.
  • Order the parts: FieldLabel (with FieldIndicator), FieldDescription, control, FieldError.
  • Put required on Field and FieldIndicator in every label (* or "(Optional)"). Never type "(optional)" yourself.
  • Pass error and disabled to the control itself. Field invalid and Field disabled do not reach Input or Textarea.
  • One helper line at most, stating the consequence.
  • Show the provider icon in the select option and trigger.

Buttons and copy

ElementWriteNot
Title"Create identity provider" / "Edit identity provider""New", "Provider settings"
SubmitTitle's verb + entity; edit: "Save changes""Submit", "OK", "Update"
Stepper"Next"; last step: "Create policy""Continue →", "Finish"
DescriptionWhat happens after submit: "We send an invitation link to this email."A restatement of the title
Cancel"Cancel""Close", "Discard"
Error"Enter a client ID.""Invalid", "Field is required!"
  • Submit is the default primary Button type='submit', last on the right. Cancel is variant='ghost' color='neutral' in DialogClose/DrawerClose asChild.
  • Omit size on footer buttons.
  • Never put submit in the header or add a second primary.
  • Stepper footer: Cancel left; Back (variant='outline' color='neutral') and Next right. Back disables itself on step 1; don't wire disabled.
  • On the last step, render submit instead of StepperNextTrigger (disabled there).

Behavior

  • Call event.preventDefault(). Close only after success.
  • Edit: prefill fields; disable submit until a change.
  • Show FieldError only after blur or submit.
  • Stepper never blocks steps. Set status='danger' on steps with errors, 'completed' on valid ones. There is no linear, isStepValid or orientation prop.

Examples

A dialog form with a 24px field stack.

Submit stays disabled until the required fields are filled, the email error shows only after blur or submit, and a successful request closes the dialog, then shows a toast.

An invalid field: error goes on the control, FieldError renders only while invalid.

Shown after blur: the description stays above the control, the error line below it.

Edit reuses the create container. A field fixed after create is disabled, with a tooltip on a wrapping span.

Fields are prefilled, and "Save changes" stays disabled until a value changes.

Numbered Timeline sections, each a 12px field stack, inside a Drawer width={700} body.

Short related fields share a two-column row; URLs and secrets get full width. "Test connection" reports in its section with an Alert, never a toast.

A Stepper wrapping body and footer; submit replaces Next on the last step.

Cancel sits left, Back and Next right. Steps never block: a step left with empty required fields turns danger, a filled one completed.

States

StateShowExample component
PristineSubmit disabled until required filledButton disabled={!canSubmit}
Invalid fieldRed border and an error lineerror on the control + FieldError
SubmittingSpinner on submitButton loading={pending} (also disables)
Server rejects one fieldMessage on that fielderror + FieldError
Server rejects the requestError atop the body; values keptAlert color='destructive'
"Test connection" resultIn the section, never a toastAlert color='success' / 'destructive'
Later section not readyDisabled, with why: "Select a service first"FieldDescription
Field fixed after createDisabled, with a tooltipTooltipTrigger asChild on a span
Dirty closeUnsaved-changes dialogVariant D in Confirmation dialogs
SuccessClose, then a toastuseToast().create({ title: 'User created', type: 'success' })

What your app owns

  • Values, validation, touched/dirty state, the request and server errors.
  • Values across close: containers unmount content, so lift state out.
  • The unsaved-changes guard: intercept onOpenChange(false).
  • Current step and statuses (step, onStepChange, status).
  • Focusing the first invalid field after submit.
  • The toast: useToast from @wallarm-org/design-system/Toast, one Toaster at the root.
  • A live preview (SSO "Continue with …"): build it from Button in a grid grid-cols-2 gap-12 row.

FieldIndicator, Dialog* and useToast import from subpaths. Where the Stepper story differs, follow this page.