Ionic tab bar circle middle button

Today I’ll be showing you how to make a circle middle button inside a tab bar.

It’s a way to make a button stand out more from the tab bar, and it can be your center of attention inside your app.

Circle middle tab bar button

We won’t be …


This content originally appeared on DEV Community and was authored by Chris Bongers

Today I'll be showing you how to make a circle middle button inside a tab bar.

It's a way to make a button stand out more from the tab bar, and it can be your center of attention inside your app.

Ionic tab bar circle middle button

Circle middle tab bar button

We won't be making everything from scratch, so if you plan to work with me on this article, download the Ionic tab bar starter from GitHub.

From there, open up the project in your editor of choice.
If we then run the application, we will get a basic tab bar, and we will focus on changing this tab bar.

Ionic basic tabbar

Open up the tabs/tabs.page.html file.

For our example, we will make five buttons in our tab bar. The middle one will be outstanding.

Let's start by adding the five buttons and make the middle one an empty one.

<ion-tabs>
  <ion-tab-bar slot="bottom">
    <ion-tab-button tab="tab1">
      <ion-icon name="triangle"></ion-icon>
      <ion-label>Tab 1</ion-label>
    </ion-tab-button>

    <ion-tab-button tab="tab2">
      <ion-icon name="ellipse"></ion-icon>
      <ion-label>Tab 2</ion-label>
    </ion-tab-button>

    <ion-tab-button></ion-tab-button>

    <ion-tab-button tab="tab3">
      <ion-icon name="square"></ion-icon>
      <ion-label>Tab 4</ion-label>
    </ion-tab-button>

    <ion-tab-button tab="tab3">
      <ion-icon name="egg"></ion-icon>
      <ion-label>Tab 5</ion-label>
    </ion-tab-button>
  </ion-tab-bar>
</ion-tabs>

This will result in the following:

Ionic 5 tabs

You might think, cool, but we are missing that bottom one!
And you're right, so what we'll do is add a FAB button for that.

It will take place outside of our tabs and look like this.

<ion-fab vertical="bottom" horizontal="center" slot="fixed">
  <ion-fab-button>
    <ion-icon name="leaf"></ion-icon>
  </ion-fab-button>
</ion-fab>

And this will give us the following:

Middle fab button tab bar Ionic

Cool and simple right?
You can find today's code on GitHub as well!

Thank you for reading, and let's connect!

Thank you for reading my blog. Feel free to subscribe to my email newsletter and connect on Facebook or Twitter


This content originally appeared on DEV Community and was authored by Chris Bongers


Print Share Comment Cite Upload Translate Updates
APA

Chris Bongers | Sciencx (2021-05-19T06:32:58+00:00) Ionic tab bar circle middle button. Retrieved from https://www.scien.cx/2021/05/19/ionic-tab-bar-circle-middle-button/

MLA
" » Ionic tab bar circle middle button." Chris Bongers | Sciencx - Wednesday May 19, 2021, https://www.scien.cx/2021/05/19/ionic-tab-bar-circle-middle-button/
HARVARD
Chris Bongers | Sciencx Wednesday May 19, 2021 » Ionic tab bar circle middle button., viewed ,<https://www.scien.cx/2021/05/19/ionic-tab-bar-circle-middle-button/>
VANCOUVER
Chris Bongers | Sciencx - » Ionic tab bar circle middle button. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2021/05/19/ionic-tab-bar-circle-middle-button/
CHICAGO
" » Ionic tab bar circle middle button." Chris Bongers | Sciencx - Accessed . https://www.scien.cx/2021/05/19/ionic-tab-bar-circle-middle-button/
IEEE
" » Ionic tab bar circle middle button." Chris Bongers | Sciencx [Online]. Available: https://www.scien.cx/2021/05/19/ionic-tab-bar-circle-middle-button/. [Accessed: ]
rf:citation
» Ionic tab bar circle middle button | Chris Bongers | Sciencx | https://www.scien.cx/2021/05/19/ionic-tab-bar-circle-middle-button/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.