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

CTA Modal

A modal component for displaying call-to-action messages.

  • 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 { CTAModal, useCTAModal, createCTAModalActions } from '@cerberus/react'

Usage

To use the CTAModal, wrap your component with the CTAModal provider and use the useCTAModal hook to access the show method.

To create your actions, use the createCTAModalActions function.

Note

CTAModal 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.

Loading example...

With Links

To use links instead of buttons, pass your link components to the createCTAModalActions function.

Loading example...

With Content

To use a custom content component, pass your custom component to the content prop of the show method.

Loading example...

Primitives

The CTAModal is an abstraction of the Dialog Primitives and does not provide any additional customization. To build your own CTAModal, use the Dialog components.

API

The CTAModal 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
headingvoidThe heading of the modal.
description`void``The description of the modal.
iconundefinedThe icon to display in the modal.
actions[]The actions to display in the modal. Requires the use of createCTAModalActions utility.

Utilities

The createCTAModalActions utility accepts an array of objects with the following properties or ReactNodes:

Action

NameDefaultDescription
text''The text of the action.
handleClickundefinedThe click handler of the action.

Link

Pass your Array of link components to the createCTAModalActions function.

On this page

  • Import
  • Usage
  • With Links
  • With Content
  • Primitives
  • API
    • Show Method Options
    • Utilities
  • Action
  • Link
Edit this page on Github