JarodMS

Mobile App Development with Ionic, Angular, and More!

Menu
  • Home
  • Mobile Apps
  • About Me
  • Contact Me
  • Diary
Menu

Ionic 4 -Using a Custom Icon in a Tab

Posted on November 4, 2018 by Jarod

I was working on a project that needed a custom icon in the TabBar using Ionic 4 and a single custom icon. I had done this before for Ionic 3 with Fontawesome Icons. It took some trial and error, along with looking at GitHub issues, but I think I finally have it figured out. And YES! It was a LOT easier than I thought.

Environment:

  • Angular 6
  • @ionic/angular:  4.0.0-beta.15
  • Using the Tab template

This method uses SVG’s and from what I saw during testing and GitHub tickets, it will not work with PNG files. You will need to convert your PNG to SVG first. This simple fact is what caused me the most headaches. Using the same setup with a PNG file did NOT work.

  1. Save your SVG to your assets/icon folder
  2. Change the ion-icon name attribute to src
  3. Reference the SVG source that is relative to the page you are using it in

 

Initial Tab

<ion-tab-button tab="home" href="/tabs/(home:home)">
    <ion-icon name="pizza"></ion-icon>
    <ion-label>Pizza</ion-label>
</ion-tab-button>

 

Updated with Custom Icon

<ion-tab-button tab="home" href="/tabs/(home:home)">
    <ion-icon src="../../assets/icon/tab_my_custom_icon.svg"></ion-icon>
    <ion-label>Pizza</ion-label>
</ion-tab-button>
 
 
Please follow:
error
Tweet
0

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Newsletter

Signup with your email address to receive news and updates.

Search

Recent Posts

  • Not able to call REST API on Android, but it works with iOS and Web App
  • Ionic – the platform was not ready when I was trying to get the location
  • My Dividend Meter
  • Angular app using Node, JSON server, NG-Bootstrap, and NgRx
  • LoadingController example showing “Loading…” message
  • Adding the Version Number in your app
  • PhoneGap Build – Config File
  • Example Angular 8 with NgRx and Redux DevTools
  • Update an Ionic4/Angular7 app to use Angular 8
  • Ionic 4 and Angular with PouchDB

Need Help?

I’m available for Ionic and Angular contract work. Contact me to get started.

My Links

All my apps on Google Play Store
All my apps on Apple App Store
GitHub
LinkedIn

Archives

  • October 2020
  • April 2020
  • March 2020
  • November 2019
  • October 2019
  • August 2019
  • November 2018
  • August 2018
  • July 2018

Categories

  • Angular
  • Beginner
  • Ionic
  • Ionic Component
  • PhoneGap Build
  • Uncategorized
  • Visual Notification

Available for Angular and Ionic freelance work including custom app development.

Tags

Angular AuthGuard component Custom Icon Firebase Font Awesome Geolocation Google Cloud Functions icons ionic3 Ionic4 iOS NgRx PhoneGap Build tabs VirtualScroll
© 2026 JarodMS | WordPress Theme by Superbthemes