Ionic: How to display ion-item on multiple lines? Ionic: How to display ion-item on multiple lines? angularjs angularjs

Ionic: How to display ion-item on multiple lines?


For Ionic 2 users, you can use text-wrap attribute as:

<ion-item text-wrap>  Multiline text that should wrap when it is too long to fit on one line in the item.</ion-item>

You can also see the Utility Attributes Documentation for attributes that can be added to ion-item to transform the text.


EDIT: Although marked as accepted, this answer was written for an early version of Ionic. Odds are, you'll want one of the answers below for the newer versions.

Class item-text-wrap should help you out, like this:

<ion-item class="item item-text-wrap">  bio: <b> Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. </b></ion-item>


In Ionic v4 you can attach the text-wrap attribute to the ion-label component inside an ion-item. For Instance:

<ion-item>  <ion-label text-wrap>    Multiline text that should wrap when it is too long to fit on one line in the item.  </ion-label></ion-item>

EDIT for Ionic v5:Ionic CSS attributes are deprecated and will not work in v5. replace attribute tags (e.g., <ion-label text-wrap>) with ionic classes (e.g., <ion-label class="ion-text-wrap">). For example:

<ion-item>  <ion-label class="ion-text-wrap">    Multiline text that should wrap when it is too long to fit on one line in the item.  </ion-label></ion-item>

This will also work for v4