Added example of using transient
Signed-off-by: Andre Wanlin <67169551+awanlin@users.noreply.github.com>
This commit is contained in:
@@ -18,3 +18,18 @@ Added option to allow the `AlertMessage` to be self-closing. This is done with a
|
||||
```
|
||||
|
||||
The above example will set the transient timeout to 2500ms from the default of 5000ms
|
||||
|
||||
Here's a rough example of how to trigger an alert using the new `transient` boolean:
|
||||
|
||||
```ts
|
||||
import { alertApiRef, useApi } from '@backstage/core-plugin-api';
|
||||
|
||||
const exampleTransient = () => {
|
||||
const alertApi = useApi(alertApiRef);
|
||||
alertApi.post({
|
||||
message: 'Example of Transient Alert',
|
||||
severity: 'success',
|
||||
transient: true,
|
||||
});
|
||||
};
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user