StatusAlert
basic usage
Any Paragon component or export may be added to the code example.
success alert
Any Paragon component or export may be added to the code example.
danger alert
Any Paragon component or export may be added to the code example.
informational alert
Any Paragon component or export may be added to the code example.
alert with a custom aria-label on the close button
Any Paragon component or export may be added to the code example.
Non-dismissible alert
Any Paragon component or export may be added to the code example.
alert invoked via a button
Any Paragon component or export may be added to the code example.
alert with a link
Any Paragon component or export may be added to the code example.
Props API#
- alertType
string
Default'warning'specifies the type of alert that is being diplayed. It defaults to "warning". See the other available bootstrap options.
- className
string
is a string array that defines the classes to be used within the status alert.
- dialog
string
|element
Required - dismissible
bool
Defaulttruespecifies if the status alert will include the dismissible X button to close the alert. It defaults to true.
- closeButtonAriaLabelDefault'Close'
string
- onClose
isRequiredIf(PropTypes.func, props => props.dismissible)
is a function that is called on close. It can be used to perform actions upon closing of the status alert, such as restoring focus to the previous logical focusable element. It is only required if
dismissible
is set totrue
and not required if the alert is notdismissible
. - open
bool
Defaultfalsespecifies whether the status alert renders open or closed on the initial render. It defaults to false.
Usage Insights#
StatusAlert
Project Name | Paragon Version | Instance Count | |
---|---|---|---|
edx-platform | 2.6.4 | 10 | |
frontend-component-cookie-policy-banner | 20.28.4 | 1 | |
frontend-learner-portal-base | 12.2.0 | 4 | |
prospectus | 20.46.2 | 3 | |
studio-frontend | 3.4.8 | 3 |