question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Any plan to support Font Awesome 5 icon?

I manage to hack up a solution, but it would be great to have official support for it.

Use the following code to load Font Awesome 5 Icon with vue-toasted.

import fontawesome from '@fortawesome/fontawesome'
import faSolid from '@fortawesome/fontawesome-free-solid'

Vue.toasted.show(`${fontawesome.icon(faSolid.faCoffee).html} Hello`, {
  type: 'success',
  duration: 3000
})

For spacing and margin, include the following css.

.toasted-container .toasted > svg {
  margin-right: .5rem;
  margin-left: -.4rem;
}

https://code.luasoftware.com/tutorials/vuejs/vue-toasted-with-font-awesome-icon/

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:4
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

10reactions
twarlopcommented, May 29, 2019

in case you are still wondering (i’m assuming this is your intent):

import { library, dom } from '@fortawesome/fontawesome-svg-core';
import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome';
import { faExclamation } from '@fortawesome/free-solid-svg-icons';
import VueToasted from 'vue-toasted';

// add any icon you use manually
library.add(faExclamation);

// this one is the key to render the icon in the toast
dom.watch(); 

Vue.use(VueToasted, {
  iconPack: 'fontawesome',
});

// triggering a toast in a component
this.$toasted.error('something bad happened', {
  icon: 'exclamation',
});

you’ll probably want to also add this extra line of css

.toasted > svg:first-child {
  margin-right: .7rem;
}
3reactions
shakee93commented, Nov 20, 2017

Added support to fontawesome.

simply set the icon pack to fontawesome !!

Vue.use(VueToasted, {
    iconPack : 'fontawesome'
});
Read more comments on GitHub >

github_iconTop Results From Across the Web

Find the Perfect Icon for Your Project in Font Awesome 5
Search all the Version 5 icons and match your project with a look and feel that's just right. Better yet, try Font Awesome...
Read more >
Find the Perfect Icon for Your Project in Font Awesome 5
Search all the Version 5 icons and match your project with a look and feel ...
Read more >
Font Awesome
Font Awesome is the Internet's icon library and toolkit, used by millions of designers, developers, and content creators. Start for Free Get More...
Read more >
Find Icons with the Perfect Look & Feel - Font Awesome
Five styles that are always in fashion and ready to bring that extra level of iconic flair to projects. Solid. Great for bold...
Read more >
Download - Font Awesome
Font Awesome 5. LTS. v5.15.4: Released: August 2021: This version will continue to receive patch releases.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found