Skip to content

Commit 621690e

Browse files
committed
fix(alert): fix readme.md
1 parent 56e3f85 commit 621690e

File tree

1 file changed

+16
-16
lines changed

1 file changed

+16
-16
lines changed

elements/pf-alert/README.md

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# pf-alert
22

3-
The `pf-alert` web component displays PatternFly-styled alerts. It can be used inline in pages or as a toast notification. Alerts support several visual states (for example: `info`, `success`, `warning`, `danger`), an optional header slot, body content, and an `actions` slot for interactive controls.
3+
The `pf-alert` web component displays PatternFly-styled alerts. It can be used inline in pages or as a toast notification (if a static helper is provided separately). Alerts support several visual **variants** (for example: `info`, `success`, `warning`, `danger`), an optional title slot, body content, and an **action links** slot for interactive controls. Alerts can also be **closable** and **expandable**.
44

55
## Installation
66

@@ -17,22 +17,22 @@ Import the element in your page or application as an ES module:
1717
Inline alert example:
1818

1919
```html
20-
<pf-alert state="success">
21-
<h3 slot="header">Success</h3>
22-
The operation completed successfully.
23-
<div slot="actions">
24-
<pf-button variant="link">Details</pf-button>
25-
</div>
20+
<pf-alert variant="success">
21+
<span slot="title">Operation Success</span>
22+
23+
The operation completed successfully.
2624
</pf-alert>
27-
```
2825

29-
Toast usage (static helper):
26+
<pf-alert variant="info" onClose>
27+
<span slot="title">System Update</span>
28+
29+
A new system update is available.
30+
31+
<div slot="actionLinks">
32+
<pf-button plain>Update Now</pf-button>
33+
<pf-button plain>Later</pf-button>
34+
</div>
35+
</pf-alert>
36+
```
3037

31-
```html
32-
<script type="module">
33-
import '@patternfly/elements/pf-alert/pf-alert.js';
3438

35-
// Show a simple toast notification
36-
PfAlert.toast({ message: 'Saved', heading: 'Success', state: 'success' });
37-
</script>
38-
```

0 commit comments

Comments
 (0)