Level 63
I recently had the same problem.
You need to use the long syntax instead of the short syntax.
<font-awesome-icon :icon="['fas', 'chart-line']"></font-awesome-icon>
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Greeting everyone, I want to use font awesome on my vue 3 projects i followed the doc of font awesome but some icons work and some doenst
my main.js
import { createApp } from "vue";
import { createPinia } from "pinia";
import App from "./App.vue";
import router from "./router";
import '@/assets/base.css';
import '@/assets/index.css';
import { library } from "@fortawesome/fontawesome-svg-core";
import { FontAwesomeIcon } from "@fortawesome/vue-fontawesome";
import { fas } from '@fortawesome/free-solid-svg-icons'
import { fab } from '@fortawesome/free-brands-svg-icons';
import { far } from '@fortawesome/free-regular-svg-icons';
import { dom } from "@fortawesome/fontawesome-svg-core";
import vSelect from 'vue-select';
import VueApexCharts from "vue3-apexcharts";
import 'flowbite';
library.add(far,fab,fas);
dom.watch();
const app = createApp(App);
app.component('font-awesome-icon', FontAwesomeIcon);
app.component('v-select', vSelect);
app.use(createPinia());
app.use(VueApexCharts);
app.use(router);
app.mount("#app");
in my components
<font-awesome-icon icon="fa-chart-line" class="icon pr-2 "/>
@CrastyCrap You have to change faswith for example faror other categories according to your needs.
If it's ok for you, you can close the post ;).
Please or to participate in this conversation.