Feedback messages are non-intrusive, informational messages that keep users informed about various events within a system. They report a system occurrence that does not require immediate actions( different from the alert dialog that requires a user action).
Add FeedbackMessages component anywhere in your application. Note that:
FeedbackMessages component – it is not a provider, it is a regular componentFeedbackMessages components – if you do that, your messages will be duplicatedAll set! You can now use all FeedbackMessages system features.
FeedbackMessages component is to show a toast message. You can do this by calling the message function with a string as an argument. The message will be displayed in the top right corner of the screen.message function supports different message types.alert, banner, and toast to display different types of messages.toast.FeedbackMessages supports sizes sizes sm, md, lg, responsive, and can be changed by passing the size value.
Default size is lg.
You also override another size through message function.
message function supports 5 colors red, green, blue, orange and neutral and can be changed by passing the color value.blue.message function supports 6 positions top-left, top-right, top-center, bottom-left, bottom-right and bottom-center and can be changed by passing the position prop.top-right.position prop to the FeedbackMessages component.message function supports icons from the @ocean-network-express/magenta-ui/icons package.icon support to add icon or other content to the left side.message function can include links by passing the urls or actions value depending on which type of message you are using.The message function supports action buttons. You can add action buttons by passing the actions value.
The actions value is an array of objects with the following properties:
label: The text to display on the button.color is secondary, variant is outline, and size is md.Note: The actions value is only available for banner and toast types.
The message function can include links by passing the urls value.
The urls value is an array of objects with the following properties:
displayText: The text to display on the link.Note: The urls value is only available for alert and banner types.
You can custom links and actions by passing custom React components.
message function can remove the close button icon or by setting the closable value to false.message function can include the close duration by passing the duration value.0 or Infinity.duration prop to the FeedbackMessages component.style prop on the FeedbackMessages component. This will modify the default offset for all messages.FeedbackMessageType, FeedbackMessageColor ,and FeedbackMessagePosition are EnumValues exported from @ocean-network-express/magenta-ui/react.