The @jutro/router dependency and its peer dependencies like
history and react-router-dom are now optional for
component packages. However, the InlineNotification component requires
the dependency to be added to your app dependencies in order to be used.
InlineNotification component provides a mechanism to display a bundle with multiple messages. The type of object received by the message prop is used to decide the display option: single message or bundle.
In bundle module, the notification style will be decided by message with the type with the highest severity: error, warning, success and info. The bundle displays all the messages received by the component, grouping them by type.
<InlineNotification message={{ error:{ MyField:[ { fieldId:'MyField1', message:'This is a required field', type:'error', }, ], AnotherField:[ { fieldId:'MyField2', message:'Value is below minimum allowed', type:'error', }, ], }, info:{ 'Process due date':[ {message:'The process due date is on 7 days',type:'info'}, ], }, success:{ 'Claim data loaded':[ { message:'Claim information successfully retrieved', type:'success', }, ], 'Personal details are correct':[ { message:'Personal information successfully validated', type:'success', }, ], }, warning:{ 'Address not found':[ { message: 'Please review the address details and confim it is correct.', type:'warning', }, ], 'Validate starting date':[ { message:'Please confirm that the starting date is correct', type:'warning', }, ], 'Unable to validate financial details':[ {message:'No financial record found',type:'warning'}, ], }, }} isBundleOpenByDefault={true} isDismissable={false} />
Inline notifications are placed near the relevant area of the UI. They can expand in width to fill the container or content area that they relate to. The height of inline messages grows with content up to 2 lines of wrapped text.
Titles are optional for inline notifications and only to be used when you can concisely communicate the notification's main message. They should be short, descriptive, and explain the most important piece of information.
Info messages convey non-critical information or updates to users without requiring action. Use them to inform people about something that might help or impact them.
Do use info messages to convey useful extra information to the user.
Don't use info messages to alert people to critical information that requires action.
Success messages inform users that a task or action has been completed successfully. For frequent and simple actions, such as uploading a file or saving a document, keep the success message short and practical. You can use a celebratory tone for significant achievements and messages that are more infrequent in nature.
Do use language that is clear, concise, and useful. For routine tasks, adopt a practical tone.
Don't use a celebratory tone unless the situation calls for it. Consider the user's context.
Warning messages alert users to potential issues that might need their attention within the context of their current task or interaction. If the warning comes before an action, explain what will happen if the user proceeds. Provide an alternative where possible.
Do show empathy for the user. Inform, but don't alarm.
Don't induce panic with language that is overly dramatic or alarmist.
Error messages indicate that a task has failed or has errors that prevent the user from progressing to the next stage. When writing for error messages:
Explain the problem and what went wrong as precisely as you can.
Suggest how to solve the problem and carry on forward. If the problem can't be solved at that time, tell the user what can be done to help them, an who they can turn to.
Use language that is simple, clear, and direct. Avoid confusing people with technical details or jargon.
Try to use error messages that are relevant and specific to the context they appear in. The more generic, the less helpful.
Don't blame users and accept if something is our fault.
Do explain the problem using simple, clear language. Provide a solution so that users can complete the process.
Don't use technical jargon or language that is unfamiliar to the user.
Inline notifications appear only one at a time. They exist until the user dismisses them, until issue resolution, or when the user navigates away from the current page.
The close button is optional. It appears as a small "X" in the top-right corner of the inline notification. Don't include a close button if it's critical for the user to read or interact with the notification.
Inline notifications can accommodate various usage patterns. This includes bundling alerts of the same severity or different severities.
Never stack inline notifications in a way that causes content to be pushed down from view. Use the bundled messages pattern instead, as discuss in this section.
When multiple messages of the same severity arise in the app, the messages may be bundled together so that it's easier to scan and act on the messages.
Title: Gives the number of the alerts and an optional title message.
Hide/show control: Expands to view messages or collapses from view.
Alert position navigation link: Indicates where the alert has occurred and gives users the ability to navigate to the trigger.
Description: Provides contextual information about the message.
When multiple messages of different severities arise in the app, the messages may be bundled together so that it is easier to scan and act on the messages.
Title: Gives the number of alerts in order of highest priority. For example, if there are 3 errors and 3 warnings, the title should communicate the number of errors found and may include an optional title message.
Message toggle: Enables the user to toggle between alert groups. Each toggle contains an icon, which indicates the category of the alert, and the number of messages.
Navigation link: Indicates where the alert has occurred and gives users the ability to navigate to the trigger.
Description: provides contextual information about the message.
This component has been validated to meet the WCAG 2.0 AA accessibility guidelines. However, changes made by the content author can affect accessibility conformance. Follow the guidance below when using this component in your applications:
Ensure that inline notifications persist until the user dismisses them, until issue resolution, or when the user navigates away from the current page.
Don't include a close button if it's critical for the user to read or interact with the notification.
note
The @jutro/router dependency and its peer dependencies like
history and react-router-dom are now optional for
component packages. However, the InlineNotification component requires
the dependency to be added to your app dependencies in order to be used.
Make sure to understand the Design System components API surface, and the implications and trade-offs. Learn more in our introduction to the component API.