Alert
The alert component is used to give feedback to the user based on some action. These alerts can also act as response handler for some specific activity
Usage#
The Alert component has five display type which can be mentioned using the type prop. By default the alert has default as its
value. The alert component also has a label prop which is used to render the main text of the response
defaultsuccessinfowarningdanger
Example#
Code#
Title#
Alert component also has a optional title prop which renders a title for the alert
Close Icon#
Alert component also has a onClose prop which is triggered when the close icon is clicked. This is can be used if this alert component is used as a
toaster to show toast message and then, if you want to hide it you can use this prop.
Loading#
The alert component has a loading prop which shows a loading icon. This also acts as a loading indicator to the user, indicating that the requested activity is in progress.
API#
| Prop | Type | Possible values | Default Value |
|---|---|---|---|
| type | string | "default", "success", "info", "danger" and "warning" | default |
| label | string | Any string | - |
| title | string | Any string | "" |
| showLoading | boolean | true & false | false |
| onClose | () => void | - | - |
To check on when to use which check Badge component documentation
Built by Akshay 🤙