Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ionic 6 - create circle ion-button with icon

How can I create circle ion-button with ionic icon in it (based on angular)?

For example:

enter image description here

Starting point of code:

<ion-button (click)="buttonClicked()">
      <ion-icon name="send-sharp"></ion-icon>
</ion-button>

I tried these solutions but it didn't help.

like image 936
RafaelJan Avatar asked Apr 14 '26 17:04

RafaelJan


2 Answers

This how it can be done in the ionic way:

ion-button[shape=circle] {
    --border-radius: 50%;
    width: 56px;
    height: 56px;
}
<ion-button shape="circle" (click)="buttonClicked()">
  <ion-icon slot="icon-only" name="send-sharp"></ion-icon>
</ion-button>
like image 88
Rami Assi Avatar answered Apr 16 '26 10:04

Rami Assi


If just the round shape is the need, you can also use

  <ion-fab-button color="danger" size="small"  (click)="onButtonClick()">
      <ion-icon name="send-sharp"></ion-icon>
  </ion-fab-button>
like image 39
Omkar Pattanaik Avatar answered Apr 16 '26 09:04

Omkar Pattanaik



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!