Feedback
Dialog
Modal questions and confirmations.
import { ConfirmDialog, Dialog } from 'faifo-design'Dialog is a named modal with native close and submit paths. ConfirmDialog asks before an action
that is hard to undo and is always a small centred dialog, on a phone too.
#When to use
- Use
ConfirmDialogbefore delete, archive, remove, discard or reset. - A confirmation never becomes a side sheet or a full-screen page. Record and picker content uses
ModalSheet. - Name the action on the confirm button; do not label it OK.
#Examples
Each example is a specimen of the package catalogue, rendered on the server exactly as shown in its code.
#Dialog and confirmation
Named modal semantics with native close and submit paths.
Review assignment
The current owner keeps access.
Assign this record to the operations queue.
Archive record?
The record leaves active worklists but remains available in history.
Show codeHide code
import { Checkbox, ConfirmDialog, Dialog, Grid } from 'faifo-design'
export const Example = () => (
<Grid
columns={2}
items={[
<Dialog
id="details-dialog"
mode="embedded"
title="Review assignment"
description="The current owner keeps access."
closeHref="#dialog"
closeLabel="Close dialog"
body={<p>Assign this record to the operations queue.</p>}
/>,
<ConfirmDialog
id="archive-dialog"
mode="embedded"
title="Archive record?"
message="The record leaves active worklists but remains available in history."
closeHref="#dialog"
closeLabel="Cancel"
confirmLabel="Archive"
details={
<Checkbox
id="archive-understood"
name="understood"
label="Keep it out of active worklists"
/>
}
/>,
]}
/>
)#API
Generated from the package source. A property without a description has none in the source yet.
#ConfirmDialogComponent
Asks before an action that is hard to undo. Always a small centred dialog, on a phone too: a confirmation never becomes a side sheet or a full-screen page.
| Property | Description | Type | Default |
|---|---|---|---|
idrequired | – | string | – |
titlerequired | – | string | – |
closeHrefrequired | – | string | – |
closeLabelrequired | – | string | – |
description | – | string | – |
mode | – | 'overlay' | 'embedded' | 'client' | – |
size | small for a short confirmation, large for a review that needs room. | 'small' | 'default' | 'large' | 'small' |
unsavedPrompt | – | string | – |
messagerequired | – | string | – |
confirmLabelrequired | – | string | – |
confirmName | – | string | 'intent' |
confirmValue | – | string | 'confirm' |
confirmForm | – | string | – |
confirmVariant | – | ActionVariant | 'destructive' |
confirmDisabled | – | boolean | false |
details | What the person must see or acknowledge before confirming, under the message: an impact notice, or an acknowledgement checkbox inside the form named by confirmForm. | JSXChild | – |
#DialogComponent
| Property | Description | Type | Default |
|---|---|---|---|
idrequired | – | string | – |
titlerequired | – | string | – |
bodyrequired | – | JSXChild | – |
closeHrefrequired | – | string | – |
closeLabelrequired | – | string | – |
description | – | string | – |
actions | – | JSXChild | – |
mode | – | 'overlay' | 'embedded' | 'client' | – |
size | small for a short confirmation, large for a review that needs room. | 'small' | 'default' | 'large' | – |
unsavedPrompt | – | string | – |
#Types
#ConfirmDialogProps
The properties of ConfirmDialog, listed above.
#DialogProps
The properties of Dialog, listed above.
#Hooks
The data-ui values these components render. Select them in tests and behaviour; their look belongs to the design system. See Contract.
dialogconfirm-dialog-message