Skip to content

Commit

Permalink
feat(toastr): config doc
Browse files Browse the repository at this point in the history
  • Loading branch information
Tibing committed Sep 4, 2018
1 parent 5903be8 commit 93c97d0
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions src/framework/theme/components/toastr/toastr-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,43 @@ import { NbGlobalLogicalPosition, NbGlobalPosition } from '../cdk';

export const NB_TOASTR_CONFIG = new InjectionToken<NbToastrConfig>('Default toastr options');

/**
* The `NbToastrConfig` class describes configuration of the `NbToastrService.show` and global toastr configuration.
* */
export class NbToastrConfig {
/**
* Determines where on the screen toast have to be rendered.
* */
position: NbGlobalPosition = NbGlobalLogicalPosition.TOP_END;

/**
* Status chooses color scheme for the toast.
* */
status: NbToastStatus = NbToastStatus.PRIMARY;

/**
* Duration is timeout between toast appears and disappears.
* */
duration: number = 3000;

/**
* Destroy by click means you can hide the toast by clicking it.
* */
destroyByClick: boolean = true;

/**
* If preventDuplicates is true then the next toast with the same title and message will not be rendered.
* */
preventDuplicates: boolean = false;

/**
* Determines render icon or not.
* */
hasIcon: boolean = true;

/**
* Icon class that can be provided to render custom icon.
* */
icon: string = '';

constructor(config: Partial<NbToastrConfig>) {
Expand Down

0 comments on commit 93c97d0

Please sign in to comment.