ctx.message
Ant Design global message API, used to display temporary light prompts at the top center of the page. Messages close automatically after a certain period or can be closed manually by the user.
Use Cases
Type Definition
MessageInstance is the Ant Design message interface, providing the following methods.
Common Methods
Parameters:
content(string|ConfigOptions): Message content or configuration objectduration(number, optional): Auto-close delay (seconds), default is 3 seconds; set to 0 to disable auto-close
ConfigOptions (when content is an object):
Examples
Basic Usage
Internationalization with ctx.t
Loading and Manual Close
Custom Configuration with open
Close All Messages
Difference Between ctx.message and ctx.notification
Related
- ctx.notification - Top-right notifications, suitable for longer display durations
- ctx.modal - Modal confirmation, blocking interaction
- ctx.t() - Internationalization, commonly used with message

