Announcement
Communicate information or drive action via pop-up announcements
Setup Guide
Check out our guide on how to create your first announcement in minutes.
Code
Flow Configuration
The following props are available in the YAML Config defined in the Frigade Dashboard:
Possible values:
flow.back
, flow.complete
, flow.forward
, flow.restart
, flow.skip
, flow.start
, step.complete
, step.reset
, step.start
primaryButton.title
instead. The title of the primary buttonprimaryButton.uri
instead. The url to open when the primary button is clickedprimaryButton.target
instead. The target of the primary button url (default: _blank; use _self to open in the same window). Setting it to # will open the existing page and dismiss any Frigade modals.Possible values:
flow.back
, flow.complete
, flow.forward
, flow.restart
, flow.skip
, flow.start
, step.complete
, step.reset
, step.start
secondaryButton.title
instead. The title of the secondary buttonsecondaryButton.uri
instead. The url to open when the secondary button is clickedsecondaryButton.target
instead. The target of the secondary button url (default: _blank; use _self to open in the same window). Setting it to # will open the existing page and dismiss any Frigade modals.React Component Props
as
Optional
as: ElementType
<any
, keyof IntrinsicElements
>
Optional component type to wrap the child components in. Use theas={Box}
component for inline placement or the as={Dialog}
component for modal placement.
If you want to wrap the Flow in a custom component (such as your own modal), you can pass the custom component here.
dismissible
Optional
dismissible: boolean
Whether the Flow is dismissible or not
flowId
flowId: string
The Flow ID to render. You can find the Flow ID in the Frigade dashboard.
forceMount
Optional
forceMount: boolean
If true, the Flow will be mounted even if it has already been completed or dismissed. However, if the user does not match the Flow’s targeting, the Flow will not be mounted.
modal
Optional
modal: boolean
The modality of the dialog. When set to true
, interaction with outside elements will be disabled and only dialog content will be visible to screen readers.
onCloseAutoFocus
Optional
onCloseAutoFocus: (event
: Event
) => void
Event handler called when auto-focusing on close. Can be prevented.
Parameters
Name | Type |
---|---|
event | Event |
Returns
void
onComplete
Optional
onComplete: FlowHandlerProp
Handler for when the Flow is completed.
If this function a promise that evaluates to false
, the Flow will not be marked as completed.
onDismiss
Optional
onDismiss: FlowHandlerProp
Handler for when the Flow is dismissed.
If this function a promise that evaluates to false
, the Flow will not be marked as dismissed.
onEscapeKeyDown
Optional
onEscapeKeyDown: (event
: KeyboardEvent
) => void
Event handler called when the escape key is down. Can be prevented.
Parameters
Name | Type |
---|---|
event | KeyboardEvent |
Returns
void
onInteractOutside
Optional
onInteractOutside: (event
: PointerDownOutsideEvent
| FocusOutsideEvent
) => void
Event handler called when an interaction happens outside the DismissableLayer
.
Specifically, when a pointerdown
event happens outside or focus moves outside of it.
Can be prevented.
Parameters
Name | Type |
---|---|
event | PointerDownOutsideEvent | FocusOutsideEvent |
Returns
void
onOpenAutoFocus
Optional
onOpenAutoFocus: (event
: Event
) => void
Event handler called when auto-focusing on open. Can be prevented.
Parameters
Name | Type |
---|---|
event | Event |
Returns
void
onPointerDownOutside
Optional
onPointerDownOutside: (event
: PointerDownOutsideEvent
) => void
Event handler called when the a pointerdown
event happens outside of the DismissableLayer
.
Can be prevented.
Parameters
Name | Type |
---|---|
event | PointerDownOutsideEvent |
Returns
void
onPrimary
Optional
onPrimary: StepHandlerProp
Handler for when primary button is clicked.
If this function a promise that evaluates to false
, the step will not be automatically completed when clicked.
onSecondary
Optional
onSecondary: StepHandlerProp
Handler for when secondary button is clicked.
If this function a promise that evaluates to false
, the step will not be automatically completed when clicked.
variables
Optional
variables: Record
<string
, unknown
>
Variables to pass to the Flow. You can use variables in the Flow configuration to customize copy.
For instance, you can use title: Hello, ${name}!
in the Flow configuration and pass variables={{name: 'John'}}
to customize the copy.