Skip to content

Banner Alerts

Banner alerts inform users about important changes or persistent conditions in a prominent way. These alerts can be placed at the top of a page or on a particular section of a page.

Code

Variants

Along with a description that follows the title.
Primary Secondary Tertiary
packages/certara-ui/src/components/alert/alert.tsx
<certara-alert headline="Notice title" dismissible>
Along with a description that follows the title.
<div slot="alert-ctas">
<certara-button color="brand" size="sm">Primary</certara-button>
<certara-button color="secondary" size="sm">Secondary</certara-button>
<certara-button variant="link" size="sm" right-icon="arrow-up-right-from-square">Tertiary</certara-button>
</div>
</certara-alert>

certara-alert

Properties

PropertyAttributeDescriptionTypeDefault
alignContentalign-contentThe content alignment inside the alert"center" | "left" | "right"'left'
dismissibledismissibleIf true, the alert can be dismissed by clicking the close buttonbooleanfalse
headlineheadlineThe bolded first sentence of the alertstringundefined
shakeshakeIf true, the alert will shake when it appearsbooleanfalse
toasttoastif true, the alert will be displayed as a toast. fades and animates in, then typically disappears after a few seconds or is present until the user dismisses itbooleanfalse
variantvariantsets the theme/color of the alert"danger" | "info" | "success" | "warning"'info'

Events

EventDescriptionType
certaraCloseEvent emitted when the alert is closed if dismissible is trueCustomEvent<void>

Slots

SlotDescription
Default alert content
"alert-ctas"Slot for additional call-to-action buttons or links

Dependencies

Used by

Depends on

Graph

graph TD;
certara-alert --> certara-close-button
certara-form --> certara-alert
certara-toast --> certara-alert
style certara-alert fill:#f9f,stroke:#333,stroke-width:4px

Alignment

<certara-alert variant="success" align-content="center" headline="Saved!">
</certara-alert>

Animation

Use this animation to draw extra attention to an important message.
Along with a description that follows the title.
<certara-alert shake>…</certara-alert>

In Practice

  • The dismiss (X) option allows users to close a system alert which removes it from the page. Alerts should be dismissible unless they contain critical information or an important action step.
  • DO NOT include the dismiss option on Danger alerts.
  • If the dismiss option is included and there is no action available to take, do not include a button labeled “Close” or “Cancel”.

Variants

The four variants use different icons and colors to indicate the type and urgency of the message.

  • Info: informs the user of a change or gives them advice.
  • Success: lets the user know of a successful outcome. NOTE: Toast alerts are used by default for this type of messaging. Use a banner alert only if it is persistent, delayed, or if there is an additional action.
  • Warning: lets the user know about important system information that deserves caution.
  • Danger: alerts the user of a problem that requires immediate attention.

Placement

  • If the message relates to the page topic as a whole, place the alert at the top of the page.
  • If the message is specific to a section of the page, place the alert below the section header.
  • Banner alerts always span the full width of the container to which they apply.

Content guidelines

Title

  • Use plain English instead of obscure codes or abbreviations.
  • Follow the content guidelines for headings and subheadings. View guidelines

Body

  • Be concise: keep content to 1 to 2 sentences where possible
  • Clarify the benefit of the main task
  • Be written in sentence case and use appropriate punctuation
  • Avoid repeating the heading
  • Explain how to resolve the issue, particularly for warning and critical banners

Accessibility

Keyboard focus: When an urgent alert is dynamically added to the page, ensure its content receives immediate attention.

Follow the accessibility guidelines for each component found in the alert. View guidelines

Design resources

View component in Figma