Form Dialog
A Form inside a Dialog: a scrolling body with a sticky footer, Escape and outside presses blocked while pending, closes on success and returns focus, asks before discarding unsaved changes, and an optional review step before submitting.
Example
form-dialog-demo.tsxCopy code
Installation
Copy code
npm packages
@standard-schema/spec@1.1.0class-variance-authority@0.7.1Usage
ImportCopy code
API reference
FormDialog
Takes Omit< FormProps<Schema>, "onPendingChange" | "onDirtyChange" | "className" | "children" > &.
Other exports
type FormDialogOpenChangeDetailstype FormDialogOpenChangeReasontype FormDialogPropstype ReviewPrepareContexttype ReviewPrepareResulttype ReviewStatetype ReviewStepAccessibility
- Escape, outside presses and Cancel do nothing while submitting; focus returns to the trigger on success.
- confirmDiscard asks before closing with unsaved changes.
- On narrow screens it becomes a bottom sheet with a sticky footer.
Agent actions
Runs agent.snapshot() from @ui-sdk/react/agent on the live preview above.