Skip to content

Commit a258154

Browse files
committed
docs(toast): update readme
1 parent 1130d05 commit a258154

File tree

1 file changed

+21
-26
lines changed
  • projects/igniteui-angular/src/lib/toast

1 file changed

+21
-26
lines changed

projects/igniteui-angular/src/lib/toast/README.md

Lines changed: 21 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
# igx-toast
22

3-
**igx-toast** IgxToast provides information and warning messages. They could not be dismissed, are non-interactive and can appear on top, middle and the bottom of the screen.
4-
A walkthrough of how to get started can be found [here](https://www.infragistics.com/products/ignite-ui-angular/angular/components/toast.html)
3+
The Toast component shows application messages in a stylized pop-up box positioned inside the global overlay outlet(default). Toasts can't be be dismissed, they are non-interactive and can appear on top, middle, and the bottom of the screen. A walkthrough on how to get started can be found [here](https://www.infragistics.com/products/ignite-ui-angular/angular/components/toast.html)
54

65
# Usage
76

@@ -11,53 +10,49 @@ A walkthrough of how to get started can be found [here](https://www.infragistics
1110
<button (click)="toast.show()">Show toast</button>
1211
<button (click)="toast.hide()">Hide toast</button>
1312

14-
<igx-toast #toast
15-
message="Something happened!">
16-
</igx-toast>
13+
<igx-toast #toast>Well, hi there!</igx-toast>
1714
```
18-
You can set the id of the component by `id="myToast"` or will be automatically generated;
1915

20-
You can be more descriptive and set message `message="Something happened!"`.
16+
You can set the id of the component by setting the attribute `id` on the component (e.g. `id="myToast"`), or it will be automatically generated for you if you don't provide anything;
17+
18+
The toast can be shown by using the `show()` method.
2119

22-
You can show the toast by using `toast.show()` method.
20+
You can hide the toast by using the `hide()` method.
2321

24-
You can show hide toast by using `toast.hide()` method.
22+
## Toast Position
23+
You can set the `positon` property to `top`, `middle`, or `bottom`, which will position the toast near the top, middle, or bottom of the document*.
2524

26-
## Toast positioned on top
25+
*By default the toast renders inside a global overlay outlet. You can specify a different overlay outlet by setting the `outlet` property on the toast;
2726

2827
```html
2928
<button (click)="toast.show()">Show toast</button>
30-
31-
<igx-toast #toast
32-
message="Something happened!"
33-
position="IgxToastPosition.Top">
34-
</igx-toast>
29+
<igx-toast #toast position="top">Top Positioned Toast</igx-toast>
3530
```
3631

37-
You can modify the position of the toast by setting `postion="IgxToastPosition.Top"`.
38-
3932
## Toast with different content
4033

4134
```html
42-
<igx-toast #toast [position]="toastPosition">
35+
<igx-toast #toast [position]="bottom">
4336
<igx-icon>notifications</igx-icon>
4437
This message will self-destruct in 4 seconds.
4538
</igx-toast>
4639
```
4740

48-
You can display various content by placing it between the igx-toast tags. If so, the message property will be overwritten.
41+
You can display various content by placing it between the `igx-toast` tags.
4942

50-
## Toast with events
43+
## Toast Events
5144

5245
```html
5346
<button (click)="toast.show()">Show toast</button>
5447

55-
<igx-toast #toast
56-
message="Something happened!"
57-
(onShowing)="onToastShowing($event)"
58-
(onShown)="onToastShown($event)"
59-
(onHiding)="onToastShowing($event)"
60-
(onHidden)="onToastHidden($event)">
48+
<igx-toast
49+
#toast
50+
message="Something happened!"
51+
(onShowing)="onToastShowing($event)"
52+
(onShown)="onToastShown($event)"
53+
(onHiding)="onToastShowing($event)"
54+
(onHidden)="onToastHidden($event)"
55+
>
6156
</igx-toast>
6257
```
6358

0 commit comments

Comments
 (0)