Alert
Vibrant alert messages used as page banners or within forms
Banner alerts
Deprecated
These alerts should be used at the very top of a page.
<BannerAlert theme="bad"> <p> An Alert! </p> </BannerAlert>
<BannerAlert theme="good"> <p> An Alert! </p> </BannerAlert>
<BannerAlert theme="warning"> <p> A Warning! </p> </BannerAlert>
<BannerAlert theme="info"> <p> An Alert! </p> </BannerAlert>
In-page alerts
These alerts should be used inside other page elements, e.g. forms.
<InPageAlert theme="bad"> <p> Your credit card is about to expire. To keep quoting on job requests please <a href="https://example.com/"> update your credit card now </a> . </p> </InPageAlert>
<InPageAlert theme="good"> <p> Your credit card is about to expire. To keep quoting on job requests please <a href="https://example.com/"> update your credit card now </a> . </p> </InPageAlert>
<InPageAlert theme="warning"> <p> Your credit card is about to expire. To keep quoting on job requests please <a href="https://example.com/"> update your credit card now </a> . </p> </InPageAlert>
<InPageAlert theme="info"> <p> Your credit card is about to expire. To keep quoting on job requests please <a href="https://example.com/"> update your credit card now </a> . </p> </InPageAlert>
Props
BannerAlert
childrenText within the alert
TypeReact.ReactNodeDefaultnullthemeDefines the style of the alert
Type'good' | 'bad' | 'warning' | 'info'Default'info'dataTestIdA selector to hook into the React component for use in automated testing environments.
TypestringdataTestdeprecatedA selector to hook into the React component for use in automated testing environments.
Note:Deprecated in favor of the
dataTestIdpropTypestringaccessibilityLabelAccessible label for the alert. Only needed if non-textual children are provided (e.g., images, emojis). Not necessary if textual children are provided.
Typestring
InPageAlert
childrenText within the alert
TypeReact.ReactNodeDefaultnullthemeDefines the style of the alert
Type'good' | 'bad' | 'warning' | 'info'Default'info'dataTestIdA selector to hook into the React component for use in automated testing environments.
TypestringdataTestdeprecatedA selector to hook into the React component for use in automated testing environments.
Note:Deprecated in favor of the
dataTestIdpropTypestringaccessibilityLabelAccessible label for the alert. Only needed if non-textual children are provided (e.g., images, emojis). Not necessary if textual children are provided.
Typestring