Notification
Notifications notify the user with the status of an action.
Usage
Use notifications to inform users about the result of an action. There are different notifications are available for different results, or use a custom version.
Success Notification
Info Notification
Warning Notification
Error Notification
Content
- Always describe what went wrong and what the user should do next.
Accessibility
- Always provide a link back to the submit button if the user needs to resubmit a form
- Ensure the keyboard focus is moved to a notification if it appears as a result of user action
- Ensure a status message is included in the notification, do not solely rely on the notification colour.
Variations
Dismissable
Notifications can also set to dismiss with the dismissable property.
Custom Variant
Custom variants can be defined in your theme using the variants property.
Properties
Notification
Name | Values | Default |
---|---|---|
id (required) | String | |
title | ReactNode | |
variant | successinfowarningerror | info |
dismissable | Boolean | false |
onDismissCallback after a notification has been dismissed | Function | |
noMarginRemove the default margin that appears at bottom of the notification when it is displayed | Boolean | |
...Spread to outer most div - the 'focus wrapper' | JSX.IntrinsicElements["div"] |
ErrorNotification
In addition to Notification properties, ErrorNotification has a preset title.
Name | Values | Default |
---|---|---|
title | ReactNode | Oops, there's a problem... |
...Spread to outer most div - the 'focus wrapper' | JSX.IntrinsicElements["div"] |