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#
Basic#
Customized duration#
Handle Promise#
API#
Methods#
message.info(content, [duration]) => Promisemessage.success(content, [duration]) => Promisemessage.warning(content, [duration]) => Promisemessage.error(content, [duration]) => Promise
Argument#
| Argument | Type | Default | Description |
|---|---|---|---|
| content | string | ReactNode | - | content of the message |
| duration | number | 3000 | time(ms) before auto-dismiss. |