ionic-framework icon indicating copy to clipboard operation
ionic-framework copied to clipboard

how to break line in ionic 2 elements like buttons

Open m0agh opened this issue 10 years ago • 4 comments

i have a few buttons in my app's screen and i want use Icon and below of that, write the title of the button...

in ionic 2 i can't use "< br>" or h1,h2 or even display block for this purpose.

code:

<button primary>
     <ion-icon name="calendar"></ion-icon>
     Calendar
</button>

i tried like this:

<button primary>
     <h1>
         <ion-icon name="calendar"></ion-icon>
     </h1>
     <br />
     <h2>
         Calendar
     </h2>
</button>

thanks

m0agh avatar May 23 '16 15:05 m0agh

Hey @MortezaAghili ! Thanks for opening an issue with us. Instead of using extra html inside your button you can actually achieve this with just a touch of css. You can simply change the button-inner class to have a flex-flow of column. So you could just use something like this

.button-inner {
  flex-flow: column;
}

Thanks for using Ionic!

jgw96 avatar May 23 '16 15:05 jgw96

What if this feature is only desired on some buttons and not all ?

AMetnik avatar Feb 27 '17 09:02 AMetnik

@AMetnik then add a class to identify that custom icons.

japostigo-km avatar Jul 07 '17 12:07 japostigo-km

Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.

ionitron-bot[bot] avatar Sep 02 '18 13:09 ionitron-bot[bot]