In Review
Alert
Variants
Info Alert
info
Info
This is a info Alert
<div class="gi-alert-base gi-alert-info" data-testid="alert" role="alert"><span data-testid="govie-icon" role="presentation" class="material-symbols-outlined gi-block" style="font-size: 24px; font-variation-settings: "FILL" 0, "wght" 400, "GRAD" 0, "opsz" 24;">info</span><div class="gi-alert-container"><p class="gi-alert-title">Info</p><div class="mb-2xl stroke-gray-950"><p class="gi-paragraph-md gi-text-start gi-whitespace-normal ">This is a info Alert</p></div></div></div>
{{ govieAlert({ "title": "Info", "children": "<p>This is a info Alert</p>" }) }}
import { Alert } from '@govie-ds/react';
<Alert title="Info">
<Paragraph>This is a info Alert</Paragraph>
</Alert>
Success Alert
check_circle
Success
This is a success Alert
<div class="gi-alert-base gi-alert-success" data-testid="alert" role="alert"><span data-testid="govie-icon" role="presentation" class="material-symbols-outlined gi-block" style="font-size: 24px; font-variation-settings: "FILL" 0, "wght" 400, "GRAD" 0, "opsz" 24;">check_circle</span><div class="gi-alert-container"><p class="gi-alert-title">Success</p><div class="mb-2xl stroke-gray-950"><p class="gi-paragraph-md gi-text-start gi-whitespace-normal ">This is a success Alert</p></div></div></div>
{{ govieAlert({ "title": "Success", "variant": "success", "children": "<p>This is a success Alert</p>" }) }}
import { Alert } from '@govie-ds/react'; <Alert title="Success" variant="success"> <Paragraph>This is a success Alert</Paragraph> </Alert>
Error Alert
error
Error
This is an error Alert
<div class="gi-alert-base gi-alert-danger" data-testid="alert" role="alert"><span data-testid="govie-icon" role="presentation" class="material-symbols-outlined gi-block" style="font-size: 24px; font-variation-settings: "FILL" 0, "wght" 400, "GRAD" 0, "opsz" 24;">error</span><div class="gi-alert-container"><p class="gi-alert-title">Error</p><div class="mb-2xl stroke-gray-950"><p class="gi-paragraph-md gi-text-start gi-whitespace-normal ">This is an error Alert</p></div></div></div>
{{ govieAlert({ "title": "Danger", "variant": "danger", "children": "<p>This is an error Alert</p>" }) }}
import { Alert } from '@govie-ds/react';
<Alert title="Error" variant="danger">
<Paragraph>This is an error Alert</Paragraph>
</Alert>
Warning Alert
warning
Warning
This is a warning Alert
<div class="gi-alert-base gi-alert-warning" data-testid="alert" role="alert"><span data-testid="govie-icon" role="presentation" class="material-symbols-outlined gi-block" style="font-size: 24px; font-variation-settings: "FILL" 0, "wght" 400, "GRAD" 0, "opsz" 24;">warning</span><div class="gi-alert-container"><p class="gi-alert-title">Warning</p><div class="mb-2xl stroke-gray-950"><p class="gi-paragraph-md gi-text-start gi-whitespace-normal ">This is a warning Alert</p></div></div></div>
{{ govieAlert({ "title": "Warning", "variant": "warning", "children": "<p>This is a warning Alert</p>" }) }}
import { Alert } from '@govie-ds/react';
<Alert title="Warning" variant="warning">
<Paragraph>This is a warning Alert</Paragraph>
</Alert>
Dismissible Alert
info
Dismissible
This is a dismissible Alert
<div class="gi-alert-base-dismissible gi-alert-info" data-testid="alert" role="alert"><span data-testid="govie-icon" role="presentation" class="material-symbols-outlined gi-block" style="font-size: 24px; font-variation-settings: "FILL" 0, "wght" 400, "GRAD" 0, "opsz" 24;">info</span><div class="gi-alert-container"><p class="gi-alert-title">Dismissible</p><div class="mb-2xl stroke-gray-950"><p class="gi-paragraph-md gi-text-start gi-whitespace-normal ">This is a Dismissible Alert</p></div></div><button data-testid="govieIconButton-dark-flat-small-undefined" class="gi-btn gi-btn-flat-dark gi-icon-btn-small undefined gi-alert-dismiss"><span data-testid="govie-icon" role="presentation" class="material-symbols-outlined gi-block" style="font-size: 16px; font-variation-settings: "FILL" 0, "wght" 400, "GRAD" 0, "opsz" 24;">close</span></button></div>
{{ govieAlert({ "title": "Dismissible", "dismissible": true, "children": "<p>This is a dismissible Alert</p>" }) }}
import { Alert } from '@govie-ds/react'; <Alert title="Dismissible" dismissible> <Paragraph>This is a dismissible Alert</Paragraph> </Alert>
Usage
Best Practices
When to use this component
An alert may be a notification that keeps people informed of the status of the system and may or may not require the user to respond. Such notifications may be errors, warnings, and general updates. This component replace the following components in local library:
When not to use this component
On long forms, always include in-line validation in addition to any error messages that appear at the top of the form.
Status
Figma Library | Considering |
Local HTML | N/A |
Global HTML | Beta |
Global React | Beta |