Tyler B. Joudrey
Tyler B. Joudrey

Reputation: 491

How to correctly use font awesome icons in a nativescript application

I have this defined in my app.scss

.fas {
font-family: 'Font Awesome 5 Free', 'fa-solid-900';
font-weight: 900;
}

and am trying to use an icon like this

<Button class="btn fas" text="&#xf095;"></Button>

in my app. which renders as

enter image description here

from my reading this should work, but I am obviously missing some config item. Any ideas what I could be missing?

Upvotes: 0

Views: 279

Answers (1)

William Juan
William Juan

Reputation: 1415

I've had more luck using the following format of the code when using icon fonts.

const icon = String.fromCharCode(0xf095);
<Button class="btn fas" [text]="icon"></Button>

Upvotes: 1

Related Questions