Message
Display global messages as feedback in response to user operations.
When To Use
- To provide feedback such as success, warning, error etc.
- A message is displayed at top and center and will be dismissed automatically, as a non-interrupting light-weighted prompt.
Examples
Message API#
Property | Description | Type | Default Value |
---|---|---|---|
Id | ParameterID for the component's HTML | String | Uniquely Generated ID |
Class | ParameterSpecifies one or more class names for an DOM element. | String | -- |
Style | ParameterSpecifies an inline style for a DOM element. | String | -- |
RefBack | ParameterA ForwardRef instance. You can get a reference to the internal DOM by using AntDesign.ForwardRef.Current . |
ForwardRef | -- |
IMessageService API#
Method Signature | Return Type | Description |
---|---|---|
Config(MessageGlobalConfig config) | void | Configure global message options |
Destroy() | void | |
Error(OneOf<String, RenderFragment, MessageConfig> content, Double? duration, Action onClose) | Task | Show error message |
Info(OneOf<String, RenderFragment, MessageConfig> content, Double? duration, Action onClose) | Task | Show info message |
Loading(OneOf<String, RenderFragment, MessageConfig> content, Double? duration, Action onClose) | Task | Show loading message |
Open(MessageConfig config) | Task | Open message with provided configuration |
Success(OneOf<String, RenderFragment, MessageConfig> content, Double? duration, Action onClose) | Task | Show success message |
Warning(OneOf<String, RenderFragment, MessageConfig> content, Double? duration, Action onClose) | Task | Show warning message |
MessageConfig API#
Property | Description | Type | Default Value |
---|---|---|---|
Content | Content for message | OneOf<String, RenderFragment> | -- |
Duration | Time before auto-dismiss, in seconds | Double? | -- |
Icon | Icon for message | RenderFragment | -- |
Key | Unique identifier for component | String | -- |
Type | Style of message | MessageType | -- |
OnClose | Callback executed on close of message | -- |