Alert | UI components (BETA)

APPLICABLE PRODUCTS
  • Sales Hub
    • Enterprise
  • Service Hub
    • Enterprise

Use the Alert component to render an alert within a card. Use this component to give usage guidance, notify users of action results, or warn them about potential issues or failures. Alerts can be placed in components statically or triggered dynamically as the result of an action.

If you want to render an alert banner at the top of the page, check out the guidance covering the addAlert method here

uie alerts diagram

  1. Title: the alert's bolded title text which should summarize its intent or an action outcome.
  2. Body: the descriptive text that follows the title, which should provide the user with the necessary information to proceed.
  3. Variant: the color of the alert. Learn more about when to use each variant below.
import { Alert } from '@hubspot/ui-extensions'; const Extension = () => { return ( <> <Alert title="Important Info" variant="info"> This is an informative message. </Alert> <Alert title="Tip" variant="tip"> Double check fields before submitting. </Alert> <Alert title="Success"variant="success"> Operation completed successfully. </Alert> <Alert title="Warning" variant="warning" > Proceed with caution. </Alert> <Alert title="Danger" variant="danger" > This action cannot be undone. Be careful. </Alert> </> ); };
Prop Type Description
title  Required String The bolded text of the alert.
variant 'info' (default) | 'tip' | 'success' | 'warning' | 'danger' The color of the alert. See below for more information about variants.

Variants

There are five alert types, which can be set using the variant prop.

  • info: a blue alert for general messages to inform the user.
    uie-components-alerts-variants_2
  • tip: a white alert to provide guidance and tips.
    uie-components-alerts-tip
  • success: a green alert to indicate the successful completion of a task or to convey a positive CRM record status.
    uie-components-alerts-variants_1
  • warning: a yellow alert for general warnings related to the performance of the system or the status of the CRM record.
    uie-components-alerts-variants_4
  • danger: a red alert indicating an error, the degradation of a system, or a negative CRM record status. You should not use this alert type for anything other than errors and negative statuses.
    uie-components-alerts-variants_3

Usage examples

  • Use an info alert to add instructions to a custom card, such as "Fill out this form using the contact's company information."
  • Use a success alert when a user successfully submits a form in the UI extension, or to convey that a contact qualifies for enrollment in a promotional offering.
  • Use a warning alert to call attention to a contact's upcoming renewal date.
  • Use a danger alert to notify the user of a form submission error or to signify that a high-urgency ticket has lapsed.

Guidelines

  • DO: use alert text that clearly communicates to the user what they need to know.
  • DO: make alert text actionable, especially for error alerts which should provide a clear path to resolution.
  • DO: use proper punctuation, such as periods and question marks at the end of the descriptive text.
  • DO: set the alert as the first component in the extension when possible for visibility. Extensions with alerts should also be placed at the top of the CRM record by a HubSpot admin. Learn more about customizing CRM record tabs.
  • DON'T: use exclamation points in warning or error alerts. Exclamation points should only be used for short, positive messages (e.g. "Great!" or "Well done!").

Was this article helpful?
This form is used for documentation feedback only. Learn how to get help with HubSpot.