FSAI Design System
Components

ConfirmActionModal

Opinionated confirmation dialog for destructive or high-risk actions, with helper patterns for buttons and menus.

Overview

ConfirmActionModal is the shared-ui confirmation dialog used when an action should require explicit user confirmation before it executes.

The file also exports ConfirmActionButton, which is a convenience wrapper that renders a trigger and opens ConfirmActionModal for you.

In practice, there are three main ways this shows up in the platform:

  • raw controlled ConfirmActionModal
  • ConfirmActionButton for inline actions
  • Menu.ItemWithConfirmation for menu-driven destructive actions

Raw Modal Usage

Use ConfirmActionModal directly when the feature already owns modal state or needs custom follow-up behavior:

<ConfirmActionModal
  isOpen={isOpen}
  handleClose={() => setIsOpen(false)}
  onConfirm={handleDelete}
  title="Delete collection?"
  description="This action cannot be undone."
  buttonLabel="Yes, delete"
  buttonVariant="destructive"
  isPending={isDeleting}
/>

This is the most flexible option.

ConfirmActionButton

Use ConfirmActionButton when the trigger and the confirmation belong together:

<ConfirmActionButton
  title={`Delete "${event.subject}"?`}
  description="This event will be deleted permanently."
  variant="destructive"
  onConfirm={handleDelete}
  isPending={isDeleting}
>
  Delete Event
</ConfirmActionButton>

This is useful in forms, sidebars, and panel footers where a single destructive button should open a confirmation modal.

For menu-driven destructive actions, prefer Menu.ItemWithConfirmation rather than wiring menu state and a sibling modal yourself:

<Menu.ItemWithConfirmation
  label="Delete"
  icon="TrashCan02"
  variant="destructive"
  onSelect={handleDelete}
  confirmTitle="Delete item?"
  confirmDescription="This action cannot be undone."
  confirmButtonText="Delete"
/>

Menu.ItemWithConfirmation already handles opening the confirmation modal and closing the menu correctly.

Props

ConfirmActionModal

PropTypeDefaultDescription
isOpenbooleanRequired. Controls visibility.
handleClose() => voidRequired. Closes the modal.
onConfirm() => void | Promise<void>Required confirm handler. Awaited before close.
titlestringdelete-focused copyConfirmation title.
descriptionstringdelete-focused copyConfirmation body copy.
isPendingbooleanLoading state for the confirm action.
buttonLabelstring'Yes, delete'Confirm button text.
buttonVariantButtonVariant'destructive'Confirm button style.
childrenReactNodeExtra modal body content below the description.
onSuccess() => voidCalled after a successful confirm and close.

ConfirmActionButton

PropTypeDefaultDescription
childrenReactNodeRequired trigger content.
onConfirm() => voidRequired confirm handler.
titlestringModal title override.
descriptionstringModal description override.
sizeButtonProps['size']Trigger button size.
variantButtonProps['variant']Trigger button variant.
isPendingbooleanLoading state for the trigger and modal action.
skipConfirmationbooleanfalseRuns onConfirm immediately without opening the modal.
disabledbooleanDisables the trigger.
confirmButtonLabelstringOverride for the modal confirm button text.
asChildbooleanfalseUses the child as the visual trigger instead of rendering a Button.
classNamestringAdditional trigger classes.
modalChildrenReactNodeExtra content rendered inside the modal.

Brand Dashboard Usage Patterns

Representative usages:

PatternPathNotes
Non-delete destructive resetfsai/apps/brand-dashboard/src/pages/Workflows/components/config-panel/TriggerConfig.tsxGood example of overriding the delete-focused default copy.
Inline destructive buttonfsai/apps/brand-dashboard/src/pages/Home/Calendar/CalendarEventInformation/CalendarEventForm.tsxCanonical ConfirmActionButton usage in a form footer.
Menu-native confirmationfsai/apps/brand-dashboard/src/modules/locations/components/LocationPanel/LocationPanel.tsxUses Panel.Menu.ItemWithConfirmation for destructive panel actions.
Manual menu + modal statefsai/apps/brand-dashboard/src/modules/library/components/CollectionDropdown.tsxShows the more manual pattern when the menu item just opens local modal state.
Controlled deletion flowfsai/apps/brand-dashboard/src/pages/Learning/components/CoursesTab.tsxStandard raw ConfirmActionModal pattern for content deletion.

Important Conventions

  • The default title, description, and button label are delete-focused. Override them for non-delete confirmations.
  • onConfirm is awaited. If it throws, the modal stays open and onSuccess does not run.
  • Prefer Menu.ItemWithConfirmation when the action originates from a menu.
  • Prefer ConfirmActionButton when a single trigger button and its confirmation belong together.
  • Use raw ConfirmActionModal when the feature already owns state or needs multiple confirmation flows.

Guidelines

  • Do use ConfirmActionModal for destructive or high-risk actions
  • Do customize the copy when the action is not literally deleting something
  • Do show a loading state while the confirmation action is in flight
  • Don't build a custom one-off modal when this abstraction already fits
  • Don't use the raw delete defaults for non-delete confirmations

On this page