Components
FormDialog
A modal for a create or edit form — dirty tracking, a discard-changes confirm, and scroll-to-first-invalid-field.
Available since@crisp-ui-kit/crisp@0.54.2
Crisp's own Dialog/DialogBody/DialogFooter, plus everything a record-creating form needs
beyond plain chrome (crisp#548): dirty tracking with a discard-changes confirm (any
click/change/input inside the form marks it dirty; Escape/backdrop/header-×/Cancel all route
through one requestClose, which only asks when something actually changed — a stacked crisp
Dialog), a beforeunload guard for a reload or external navigation, and
scroll-to-first-invalid-field once a submit attempt finishes (crisp's own FormField already
marks every control aria-invalid, so this needs no per-field wiring).
Installation
npm install @crisp-ui-kit/crispProps
Prop
Type
Notes
createModebundles Attio's whole "New Company" create-dialog chrome (crisp#548, measured live): "(optional)" on every non-required field (viauseFormDialogOptional, below); a footer of a "Create more" switch and a single "Create record ⌘↵" button with NO Cancel — Attio's own dialog closes only from the header's × — and Cmd/Ctrl+Enter submitting from anywhere inside the dialog, including a portaledSelect/DatePickerpopover. Only set this on a create dialog; an edit dialog keepsCancel+submitLabel(unmeasured territory this pass never touched).submitLabelis ignored increateMode— Attio's own button always reads "Create record", never the object's name (measured live: "New Company"'s dialog still says "Create record", not "Create company").onSubmit(createMore)fires with whether the "Create more" switch was on at that moment — click, Enter in a field, or (increateMode) Cmd/Ctrl+Enter. An edit dialog (no switch, alwaysfalse) can ignore the argument.useFormDialogOptional(required)— call from your own field wrapper asoptional={useFormDialogOptional(required)}to pick upcreateMode's "(optional)" marker automatically; it readsfalseoutside anyFormDialog, or on an edit dialog.erroris for anything the server rejected that belongs to no one field — a per-field error still belongs on that field's ownFormField.