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
API
message and message.useMessage are exported from @ceebee/ui/client.
Message
| Property | Description | Type | Default | Version |
|---|---|---|---|---|
content | The content of the message | ReactNode | config | - | — |
duration | Time(seconds) before auto-dismiss, don't dismiss if set to 0 | number | 3 | — |
onClose | Specify a function that will be called when the message is closed | function | - | — |
className | Customized CSS class | string | - | - |
classNames | Customize class for each semantic structure inside the component. Supports object or function. | Record<SemanticDOM, string> | (info: { props })=> Record<SemanticDOM, string> | - | 6.0.0 |
content | The content of the message | ReactNode | - | - |
duration | Time(seconds) before auto-dismiss, don't dismiss if set to 0 | number | 3 | - |
icon | Customized Icon | ReactNode | - | - |
pauseOnHover | keep the timer running or not on hover | boolean | true | - |
key | The unique identifier of the Message | string | number | - | - |
style | Customized inline style | CSSProperties | - | - |
styles | Customize inline style for each semantic structure inside the component. Supports object or function. | Record<SemanticDOM, CSSProperties> | (info: { props })=> Record<SemanticDOM, CSSProperties> | - | 6.0.0 |
onClick | Specify a function that will be called when the message is clicked | function | - | - |
onClose | Specify a function that will be called when the message is closed | function | - | - |