Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added options for icon fonts and custom HTML markup instead of icon #266

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,32 @@ toaster.pop({
```
This option is given the most weight and will override the global configurations for that toast. However, it will not persist to other toasts of that type and does not alter or pollute the global configuration.

### Icon fonts and icon HTML markup

The icon in the left part of a toast can be overridden either with an icon font symbol or any custom markup.
If you would like to use *icon-bug* defined in your custom icon font, use the iconFontClass property:

```js
toaster.pop({
// ...
iconFontClass: 'icon-bug';
});
```

It is also possible to change the icon base class with the `iconFontBaseClass` property. By default, the `icon` class is used, but you might want to change it to `fa` for Font Awesome, and so on.

For placing custom HTML markup, use the following syntax:

```js
toaster.pop({
// ...
iconTemplate: '<img class="user-avatar" src="https://placekitten.com/g/30/30">';
});
```

Note that the passed HTML string is not parsed, and any directives will not make effect.


### Close Html

The close button html can be overridden either globally or per toast call.
Expand Down
Loading