An alert component with predefined types and many customization arguments.

Parameters:
NameTypeDescription
propsobject

The props for the component template.

Properties
NameTypeDescription
childrenJSX.Element

React element children.

contentstring

The content of the alert.

contentCustomAttributesobject

Custom attributes for the content.

contentCustomClassesstring | Array | object

Custom classes for the content.

ctaLabelstring

The label for the call-to-action button.

ctaLinkstring

The link href for the call-to-action button.

customAttributesobject

Any custom attributes.

customClassesstring | Array | object

An array of additional classes for the toggle.

customIconstring

An icon override for the defaults that are set based on type.

customIconPrefixstring

The prefix for the custom override.

dismissableAriaLabelstring

The aria-label for the dismiss button.

dismissableTitlestring

The title for the dismiss button.

hasCtaboolean

Whether or not the alert has a call-to-action button.

idstring

Id for the alert, auto generated if not passed.

isDismissableboolean

Whether or not the alert is dismissable.

isInlineboolean

Whether or not the alert is inline.

spacingstring | number | Array | object

The spacing for the component, string, number, object or array.

themestring

Theme for the alert, primary or cosmos.

typestring

The type of the alert. Default, notice, success, error and accessibility.

refobject | null

Ref to the component.

Since
  • 2.1.0
Returns:

The alert component.

Type: 
JSX.Element
Example
import Alert from '@gravityforms/components/react/admin/modules/Alert';
import Text from '@gravityforms/components/react/admin/elements/Text';

return (
    <Alert>
        <Text content="Some text for my alert!">
    </Alert>
);