Toasts types

Here is the documentation for the types exported by the library.

2024-02-01
1 min read
rperezll

To use the library, we must utilize the types to adhere to the function specifications.

Customization

There are types that define the structures to extend the library’s default configurations.

Config

The config type is used to extend the entire alignment and color configuration of our toasts.

import { type Config } from "ng-fast-toast";
PropertyTypeDescription
align'left' 'right'Defines the alignment of the toast (default left)
customToastBgColorTypes[]An array of custom background colors for the toast, defined by BgColorTypes.

BgColorTypes

import { type BgColorTypes } from "ng-fast-toast";
PropertyTypeDescription
typeNotificationTypeSpecifies the notification type, which determines the toast style.
bgToastColorstringThe background color of the toast.
borderToastColorstringThe border color of the toast.
titleSvgColorstringThe color of the SVG icon (if present) in the toast title.
titleTextColorstringThe text color of the toast title.
contentTextColorstringThe text color of the toast content.
progressCircleColorstringThe color of the progress circle (if applicable).
contentColorstringThe background color of the content area.

Toast

Now the types that make up the toast itself are specified.

NotificationType

import { type NotificationType } from "ng-fast-toast";
  • success | info | warning | error

Notification

import { type Notification } from "ng-fast-toast";
PropertyTypeDescription
titlestringThe title of the notification.
contentstringThe main content of the notification. (Required)
durationnumberThe duration (in seconds) the notification will be visible.