Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ionic Ion-Button icon-only

Tags:

ionic2

ionic3

I'm very new in Ionic2 or Ionic at all. I set up a new project and want to design a small menu at the bottom of the foot of my page. I didn't do anything else on this project and trying to imitate the steps of a tutorial video. but when I use the icon-only directive on a button the background of the button only becomes a bit smaller. The background doesn't disappear.

<ion-content class="bg-image" padding>
</ion-content>
<ion-footer>
  <ion-toolbar>
    <button ion-button icon-only>
      <ion-icon name="home"></ion-icon>
    </button>
    <button ion-button icon-only>
      <ion-icon name="add"></ion-icon>
    </button>
  </ion-toolbar>
</ion-footer>

Here's my code. I hope you can help me.

like image 634
Christian Gehn Avatar asked Oct 02 '17 07:10

Christian Gehn


People also ask

How do I change the color of my ion buttons?

A color can be applied to an Ionic component in order to change the default colors using the color attribute. Notice in the buttons below that the text and background changes based on the color set. When there is no color set on the button it uses the primary color by default.

How do you make a button round in ionic?

Round Shape Button You can do it by adding the round property in the button as like below: <ion-button shape="round" >Round Button</ion-button>

What is slot in ion-button?

The Buttons component is a container element. Buttons placed in a toolbar should be placed inside of the <ion-buttons> element. The <ion-buttons> element can be positioned inside of the toolbar using a named slot.


1 Answers

For Ionic 4 - <ion-button fill="clear">

You can use the fill property now, e.g:

<ion-button (click)="onClick()" fill="clear">
      <ion-icon slot="icon-only" name="home"></ion-icon>
</ion-button>
like image 156
Kapil Raghuwanshi Avatar answered Sep 21 '22 16:09

Kapil Raghuwanshi