DocsBlog

Get Started

Components

Data Grid

Signals

Styling

Theming

↑↓Navigate
↵Select
EscClose
  • 1.8.0

  • Day

    Night

    Preview

    Switch mode
  • cerberus

    acheron

    elysium

    oceanus

Get Started
Components
Data Grid
Signals
Styling
Theming

Concepts

OverviewCompositionCerberus ContextTesting

Layout

Aspect RatioBleedBoxCenterContainerContainer QueryDividerFlexFloatGridGroupLink OverlayScrollableStackWrap

Components

AccordionAdmonitionAvatarButtonCarouselCheckboxClipboardCollapsibleComboboxConfirm ModalCTA ModalDate PickerDialogFieldFieldsetFile UploaderIconButtonInputLoading StatesMarqueeMenuNotificationsNumber InputPaginationPin InputPopoverProgress IndicatorsPrompt ModalRadioRatingSelectSliderSplit ButtonSwitchTableTabsTagTextTextareaToggleTooltip

Utilities

Client OnlyDownload TriggerEnvironmentFeature FlagsFocus TrapForFormat ByteFormat NumberFormat Relative TimeFormat Relative TimeFrameHighlightJSON Tree ViewLocalePortalPresenceShowSwapsplitPropsTheme

Confirm Modal

The Confirm Modal component provides a way to confirm actions with users, ensuring they are aware of the consequences before proceeding.

  • npm
  • source
  • recipe
  • Ark
View as Markdown
Open this page in Markdown
Anthropic
Open in Claude
Ask questions about this page
OpenAI
Open in ChatGPT
Ask questions about this page

Import

import { ConfirmModal, useConfirmModal } from '@cerberus/react'

Note

ConfirmModal is considered a dialog template. This means it's a pre-configured layout that is not fully customizable by nature. If you want to fully customize the modal, use the Dialog instead.

Usage

The ConfirmModal component is a controlled abstraction of the Dialog.

Loading example...

Destructive

To show a destructive confirm modal, set the kind prop in the options to 'destructive'.

Loading example...

No Avatar

To change the visibility of the avatar, set showAvatar to false in the options.

Loading example...

Primitives

The layers of the ConfirmModal which can be used to create a fully custom solution are the same as the Dialog.

Data Attributes

The primitives additionally use the same data attributes as the Dialog.

API

ConfirmModal

The ConfirmModal component is an abstraction of the Dialog and accepts the same props as the Dialog component.

Show Method Options

The show method accepts the following options:

NameDefaultDescription
showAvatartrueWhether to show the avatar in the modal.
kindnon-destructiveThe variant used to theme the modal.
headingThe heading of the modal.
descriptionThe description of the modal. For non-destructive modals only, can be a ReactNode.
actionTextThe text for the action button.
cancelTextThe text for the cancel button.

On this page

  • Import
  • Usage
  • Destructive
    • No Avatar
  • Primitives
    • Data Attributes
  • API
    • ConfirmModal
    • Show Method Options
Edit this page on Github