SuccessDialog
BasicFeedback
<co-success-dialog>SuccessDialog confirms a major completed task with a green check, an "... Successfully" title and an Okay button.
import { SuccessDialog } from 'health-components';
Examples
With Next Step
Patient Added
Open From Button
Usage
<SuccessDialog title="Electronic Claim Submitted Successfully" onOkay={close}>The 277CA usually arrives within 24 hours.</SuccessDialog>
When to use
- End of a multi-step flow: claim submitted, patient added, ERA posted, check-in complete.
When not to use
- Small saves: Toast.
Variants and states
| Variant | What it is |
|---|---|
| default | Title, body, Okay. |
| with next step | A secondary button such as "Add Another Patient". |
Accessibility
- alertdialog; Okay gets focus.
- The check is white on
success(an icon, 3:1 rule).
Do and don't
- Do: Body says what happens next: "Availity will return a 277CA within 24 hours."
- Don't: Use it for errors.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
title * | string | — | "... Successfully" title, such as "Electronic Claim Submitted Successfully". Required. |
children | ReactNode | none | Body: what happens next |
okayLabel | string | "Okay" | Okay button label |
onOkay | () => void | none | Okay handler |
secondary | string | none | Secondary button label, such as "Add Another Patient" |
onSecondary | () => void | none | Secondary button handler |
open | boolean | true | Whether the dialog is shown |
onClose | () => void | `onOkay` | Called on Escape |
inline | boolean | false | Render in place for docs |
Also accepts native attributes, including defaultChecked, defaultValue, autoFocus, plus className and event handlers on the root element.
Angular, Vue and HTML
Register the elements once (Angular guide), then use <co-success-dialog>. Attributes take strings; arrays and objects are set as properties (Angular [prop], Vue :prop) or as JSON attributes. Callbacks are DOM events with the value in event.detail.
Angular template
<co-success-dialog title="…" okay-label="…" [defaultValue]="defaultValue" (co-okay)="onOkay($event.detail)">…</co-success-dialog>
| Kind | Name | Description |
|---|---|---|
| attribute | title | "... Successfully" title, such as "Electronic Claim Submitted Successfully". Required. |
| attribute | okay-label / okayLabel | Okay button label; default "Okay" |
| attribute | secondary | Secondary button label, such as "Add Another Patient"; default none |
| attribute | open | Whether the dialog is shown; default true |
| attribute | inline | Render in place for docs; default false |
| attribute | default-checked / defaultChecked | |
| property / JSON attribute | default-value / defaultValue | |
| attribute | auto-focus / autoFocus | |
| event | co-okay | Okay handler; default none (React: onOkay) |
| event | co-secondary | Secondary button handler; default none (React: onSecondary) |
| event | co-close | Called on Escape; default `onOkay` (React: onClose) |
| slot | (default) | Body: what happens next; default none |