Skip to content

Commit

Permalink
docs(toast/snackbar): remove overlaySettings sections
Browse files Browse the repository at this point in the history
  • Loading branch information
SisIvanova committed Nov 4, 2024
1 parent a3131f0 commit 8c72f23
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 47 deletions.
39 changes: 20 additions & 19 deletions en/components/snackbar.md
Original file line number Diff line number Diff line change
Expand Up @@ -254,29 +254,30 @@ public restore() {
iframe-src="{environment:demosBaseUrl}/notifications/snackbar-sample-4" >
</code-view>

### Overlay Settings
The [`IgxSnackbarComponent`]({environment:angularApiUrl}/classes/igxsnackbarcomponent.html) uses [Overlay Settings]({environment:angularApiUrl}/interfaces/overlaysettings.html) to control the position of its container. The default settings can be changed by defining Custom OverlaySettings and passing them to the snackbar `open()` method:
### Positioning
Use [`positionSettings`]({environment:angularApiUrl}/classes/igxtoastcomponent.html#positionSettings) property to configure where the snackbar appears. By default, it is displayed at the bottom of the page. In the sample below, we set notification to appear at the top position.

```typescript
public customSettings: OverlaySettings = {
positionStrategy: new GlobalPositionStrategy(
{
horizontalDirection: HorizontalAlignment.Left,
verticalDirection: VerticalAlignment.Top
}),
modal: true,
closeOnOutsideClick: true,
};

snackbar.open(customSettings);
```html
<!--sample.component.html-->
<div>
<button igxButton="contained" (click)="open(snackbar)">Show notification on top</button>
<igx-snackbar #snackbar>Notification displayed</igx-snackbar>
</div>
```

Users can also provide a specific outlet where the snackbar will be placed in the DOM when it is visible:

```html
<igx-snackbar [outlet]="igxBodyOverlayOutlet"></igx-snackbar>
<div #igxBodyOverlayOutlet igxOverlayOutlet></div>
```typescript
// sample.component.ts
import { VerticalAlignment, HorizontalAlignment } from 'igniteui-angular';
// import { VerticalAlignment, HorizontalAlignment } from '@infragistics/igniteui-angular'; for licensed package
...
public open(snackbar) {
snackbar.positionSettings.verticalDirection = VerticalAlignment.Top;
snackbar.positionSettings.horizontalDirection = HorizontalAlignment.Right;
snackbar.open();
}
...
```

## Styling
To get started with styling the snackbar, we need to import the index file, where all the theme functions and component mixins live:

Expand Down
29 changes: 1 addition & 28 deletions en/components/toast.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,6 @@ public showMessage() {
}
```

> [!WARNING]
> The igx-toast component `show` and `hide` methods have been deprecated. `open` and `close` should be used instead.
## Examples

### Hide/Auto Hide
Expand Down Expand Up @@ -178,30 +175,6 @@ public open(toast) {
iframe-src="{environment:demosBaseUrl}/notifications/toast-sample-5" >
</code-view>

### Overlay Settings
The [`IgxToastComponent`]({environment:angularApiUrl}/classes/igxtoastcomponent.html) uses [Overlay Settings]({environment:angularApiUrl}/interfaces/overlaysettings.html) to control the position of its container. The default settings can be changed by defining Custom OverlaySettings and passing them to the toast `open()` method:

```typescript
public customSettings: OverlaySettings = {
positionStrategy: new GlobalPositionStrategy(
{
horizontalDirection: HorizontalAlignment.Left,
verticalDirection: VerticalAlignment.Top
}),
modal: true,
closeOnOutsideClick: true,
};

toast.open(customSettings);
```

Users can also provide a specific outlet where the toast will be placed in the DOM when it is visible:

```html
<igx-toast [outlet]="igxBodyOverlayOutlet"></igx-toast>
<div #igxBodyOverlayOutlet igxOverlayOutlet></div>
```

<div class="divider--half"></div>

## Styling
Expand All @@ -215,7 +188,7 @@ To get started with styling the toast, we need to import the index file, where a
// @import '~igniteui-angular/lib/core/styles/themes/index';
```

Following the simplest approach, we create a new theme that extends the [`toast-theme`]({environment:sassApiUrl}/index.html#function-toast-theme) and accepts the `$shadow`, `$background`, `$text-color` and the `$border-radius` parameters.
Following the simplest approach, we create a new theme that extends the [`toast-theme`]({environment:sassApiUrl}/index.html#function-toast-theme) and accepts the `$background`, `$text-color` and `$border-radius` parameters.

```scss
$custom-toast-theme: toast-theme(
Expand Down

0 comments on commit 8c72f23

Please sign in to comment.