Skip to content
Eskais UI

Forms

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

Installation

npx shadcn@latest add @eskais/form-dialog
npm packages@standard-schema/spec@1.1.0class-variance-authority@0.7.1

Usage

Import
import { FormDialog } from "@/components/ui/form-dialog"

API reference

FormDialog

Takes Omit< FormProps<Schema>, "onPendingChange" | "onDirtyChange" | "className" | "children" > &.

Other exports

type FormDialogOpenChangeDetailstype FormDialogOpenChangeReasontype FormDialogPropstype ReviewPrepareContexttype ReviewPrepareResulttype ReviewStatetype ReviewStep

Accessibility

  • 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.